Readarray

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

import java.util.

*;
class Readarray
{
public static void main(string args[])
{
int n,i;
scanner sc=new scanner(system.in);
system.out.println("Enter no of elements");
n=sc.nextInt();
int a[]=new int[n];
system.out.println("Enter"+n+"elements");
for(i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
{
for(i=0;i<n;i++)
{
system.out.println(a[i]);
}
}
}

You might also like