- import java.io.DataInputStream;
- import java.io.*;
- class InitArray
- {
- public static void main(String args[])
- {
- try
- {
- int n;
- int a[]= new int [20];
- DataInputStream in = new DataInputStream(System.in);
- System.out.println("Enter the Array Limit");
- n=Integer.parseInt(in.readLine());
- System.out.println("Enter the Array elements");
- for(int i=0;i<n;i++)
- {
- a[i]=Integer.parseInt(in.readLine());
- }
- System.out.println("Array elements");
- for(int i=0;i<n;i++)
- {
- System.out.println(a[i]);
- }
- }
- catch (Exception e)
- {
- }
- }
- }