Coding challenge-2 Solution
Coding Challenge#2 Solution.
Here,goes the solution--

Explanation of the code--
Here,goes the solution--

Explanation of the code--
- Import Scanner class,create object s and take n as input.
- The variable lastdig stores last digit of n and firstdig stores first digit of n finally at line 23.
- Rest is the number after removing first and last digit.
- Restfinal is the reverse of rest.
- Length stores length of variable.
- for loop from 17 to 19 stores length of n.
- for loop from 22 to 25 stores first digit.
- For loop from 29 to 31 reverses rest to restfinal.
- And,finally line 33 gives the required number.
- And fi the final value is printed.
Output--
1)Navigate to file and compile the file.
2)Run the file.
3)Provide a input and get the result.
Thank You for Visiting our blog.
Please Share!
Please Stay Tuned for More amazing Content.




0 Comments