1 public class TakingInput {
2
3 public static void main(String[] args) {
4
5 Scanner s = new Scanner(System.in);
6
7 System.out.println("enter number of elements");
8
9 int n=s.nextInt();
10
11 int arr[]=new int[n];
12
13 System.out.println("enter elements");
14
15 for(int i=0;i<n;i++){//for reading array
16 arr[i]=s.nextInt();
17
18 }
19
20 for(int i: arr){ //for printing array
21
22 System.out.println(i);
23
24 }
25
26
27 }
28
29}
30