Program to Calculate Arithmetic Mean.

Definition:- The arithmetic mean, also called the average or average value, is the quantity obtained by summing two or more numbers or variables and then dividing by the number of numbers or variables. The arithmetic mean is important in statistics.

Program:-

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n, i, arr[50], sum=0;
cout<<"How many number you want to enter ?\n";
cin>>n;
cout<<"Enter "<<n<<" Numbers :";
for(i=0; i<n; i++)
{
cin>>arr[i];
sum=sum+arr[i];
}
int armean=sum/n;
cout<<"Arithmetic Mean = "<<armean;
getch();
}

Output:-

Program to Calculate Arithmetic Mean.

Post a Comment

0 Comments