SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[15],sum=0,i;
float avg;
clrscr();
printf("Enter 20 number:");
for(i=0;i<20;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("\nSum is %d",sum);
avg=sum/20;
printf("\nAverage is %f",avg);
getch();
}
No comments :
Post a Comment