import java.util.*;
class SetA4
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
System.out.println("Enter array size : ");
int size = s.nextInt();
System.out.println("Enter elements in array : ");
int arr[] = new int[size];
for(int i=0;i<size;i++)
{
arr[i]=s.nextInt();
}
System.out.println("Reverse array : ");
for(int i=size-1; i>=0;i--)
System.out.println(arr[i]+"");
}
}
Comments
Post a Comment