Computer Science, asked by Jatin63891, 3 months ago

Write a program in Java to display the natural numbers 1 to 10 in the reverse order.

Please answer it

Answers

Answered by Anonymous
4

Reverse a number using for loop

  1. public class ReverseNumberExample2.
  2. {
  3. public static void main(String[] args)
  4. {
  5. int number = 123456, reverse = 0;
  6. //we have not mentioned the initialization part of the for loop.
  7. for( ;number != 0; number=number/10)
  8. {
Similar questions