Write a program in Java to display the natural numbers 1 to 10 in the reverse order.
Please answer it
Answers
Answered by
4
Reverse a number using for loop
- public class ReverseNumberExample2.
- {
- public static void main(String[] args)
- {
- int number = 123456, reverse = 0;
- //we have not mentioned the initialization part of the for loop.
- for( ;number != 0; number=number/10)
- {
Similar questions