ACCEPT 20 VALUES IN AN INT ARRAY & PRINT AT THE OUTPUT AVERAGE OF ALL VALUES


#include<stdio.h>
#include<conio.h>
void main()
{
int a[20],i,avg,s=0;
printf("Enter 20 Values");
for(i=0;i<19;i++)
  {
  scanf("%d",&a[i]);
  }
  for(i=0;i<20;i++)
    {
    s=s+a[i];
    }
    avg=s/20;
    printf("Average=%d",avg);
getch();
}

0 comments: (+add yours?)

Post a Comment