/* 1 PROGRAM TO CALCULATE ARITHMETIC MEAN FOR INDIVIDUAL SERIES */
#include<stdio.h>
int main()
{
int i,n,x[10];
float sum=0,AM=0;
printf("Enter No. of observations:-\t");
scanf("%d",&n);
printf("Enter the values:-\t");
for(i=0;i<n;i++)
{
printf("\n");
scanf("%d",&x[i]);
sum=sum+x[i];
}
AM=sum/n;
printf("The Arithmetic Mean is:-\t");
printf("\n sum= %f",sum);
printf("\n AM=%f",AM);
return 0;
}
/* OUTPUT:-
Enter No. of observations : - 5
Enter the values:-
11
22
33
44
55
The Arithmetic Mean is:-
sum= 165.000000
AM=33.000000 */
😊😀😚👀
No comments:
Post a Comment
This Blog helps you to learn basics to high level programming coding and practicals.
conceptual understanding