Program to find the sum and average of N given numbers.

class test
{ public static void main(String[] asd)throws IOException
BufferedReader obj= new BufferedReader(new InputStreamReader(;
String num;
int sum=0;
System.out.print("Enter the number of value you want to enter in ARRAY:: ");
int n=Integer.parseInt(num);
int arr[]=new int[n];
System.out.println("Enter the values of array..not more then "+n);
for(int i=0;i<n;i++)
{   num=obj.readLine();

for(int i=0;i<n;i++)
double avg=(double)sum/n;
System.out.print("Sum of the N given numbers is ="+sum+" and average of them="+avg+".");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s