You are on page 1of 2

Roll No: 53

Practical No 13

Array:
import java.util.*;

public class pr13

public static void main(String args[])

int a;

Scanner sc=new Scanner(System.in);

System.out.println("Enter the number of elements in array :");

a=sc.nextInt();

System.out.println(" elements in array :");

int b[]=new int[a];

for(int i=0;i<a;i++)

b[i]=sc.nextInt();

for(int i=0;i<a;i++)

System.out.println(" elements = "+b[i]);

}
Output:
Enter the number of elements in array : 5

elements in array : 1

elements = 1

elements = 2

elements = 6

elements = 8

elements = 9

You might also like