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:-
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