CODING:
#include<stdio.h>
#include<conio.h>
void main( )
{
int n;
float a[100],i,am,sum=0;
clrscr( );
printf("Enter number of terms ");
scanf("%d",&n);
printf("Enter %d values ",n);
for(i=1;i<=n;i++)
{
scanf("%f",&a[i]);
sum=sum+a[i];
}
am=sum/n;
printf("\n\nArithmetic Mean = %f",am);
getch( );
}
#include<stdio.h>
#include<conio.h>
void main( )
{
int n;
float a[100],i,am,sum=0;
clrscr( );
printf("Enter number of terms ");
scanf("%d",&n);
printf("Enter %d values ",n);
for(i=1;i<=n;i++)
{
scanf("%f",&a[i]);
sum=sum+a[i];
}
am=sum/n;
printf("\n\nArithmetic Mean = %f",am);
getch( );
}
CODING |
OUTPUT |
For any query or suggestion please comment below.....
what about geometric mean....
ReplyDeleteFor that we need to calculate anti-log, which seems to be difficult. There are various methods to calculate anti-log on Internet but no one works perfectly. (not sure about their working)
Delete