13/*Write a ‘C’ program to accept ‘n’ numbers from user, store these numbers into an array and calculate average of ‘n’ numbers*/


#include<stdio.h>
#include<conio.h>
void main()
{
int n[10],i,sum=0;
float average;
clrscr();
for(i=0;i<10;i++)
{
printf(“\nenter number %d”,i);
scanf(“%d”,&n[i]);
sum=sum+n[i];
}
for(i=0;i<10;i++)
printf(“\ngiven number %d is”,n[i]);
average=(float)sum/10;
printf(“\naverage of given 10 number is %f”,average);
getch();
}

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s