import java.io.*;
class simple_print_array
{
public static void main(String args[])
{
int a[]=new int[10];
int i,n;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter the size of array");
n=Integer.parseInt(cin.readLine());
System.out.println("Enter the element of array");
for(i=0;i<n;i++)
{
a[i]=Integer.parseInt(cin.readLine());
}
System.out.println("The element of array are ");
for(i=0;i<n;i++)
{
System.out.println(a[i]);
}
}
catch(Exception e)
{
System.out.println("wrong data");
}
}
}
class simple_print_array
{
public static void main(String args[])
{
int a[]=new int[10];
int i,n;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter the size of array");
n=Integer.parseInt(cin.readLine());
System.out.println("Enter the element of array");
for(i=0;i<n;i++)
{
a[i]=Integer.parseInt(cin.readLine());
}
System.out.println("The element of array are ");
for(i=0;i<n;i++)
{
System.out.println(a[i]);
}
}
catch(Exception e)
{
System.out.println("wrong data");
}
}
}
No comments:
Post a Comment