import java.util.Scanner;
public class array
{
public static void main(String [] ar)
{Scanner input=new Scanner (System.in);
{
int i;
int[] data=new int [5];
for(i=0; i<5; i++)
{
System.out.print( "data ke "+i+" = ");
data [i]=input.nextInt();
}
System.out.print("data array :");
for(i=0;i<5;i++)
{
System.out.print(" "+data[i]);
}
System.out.print(" ");
System.out.print(" ");
for(i=4;i>=0;i--)
{
System.out.print(" "+data[i]);
}
}
}
}
Tidak ada komentar:
Posting Komentar