Write a java program to print N numbers in revers order. - Pratik Ghelani

Pratik Ghelani

Breaking

Friday, January 25, 2019

Write a java program to print N numbers in revers order.

Program:-

import java.util.Scanner;
public class p5ex{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int i,j,n;
System.out.println("enter the size of array:");
n=s.nextInt();
System.out.println("revers value is:");
for(i=n;i>0;i--)
{
System.out.println(i);
}
}

}

Output:-






No comments:

Post a Comment