Source code:
//Write a C Program to Calculate mean of 10 numbers
#include <stdio.h>
int main()
{
int num[10];
int i, Number=10;
int Mean, Sum=0;
for(i=0; i<Number; i++)
{
printf("Enter the value for %d: ",i);
scanf("%d", &num[i]);
}
for(i=0; i<Number; i++)
{
Sum = Sum + num[i];
}
Mean = Sum/Number;
printf("%d",Mean);
return 0;
}
Output:
No comments:
Post a Comment