C++ Programming Code Examples C++ > Mathematics Code Examples Calculate Arithmetic Mean Calculate Arithmetic Mean To calculate arithmetic mean of numbers in C++ Programming, you have to ask to the user to enter number size then ask to enter the numbers of that size. To calculate arithmetic mean of all numbers, first perform addition of all the numbers, then make a variable responsible for the arithmetic mean and place addition/size in a variable say armean (arithmetic mean), then display the result on the output screen as shown here in the following program. Following C++ program ask to the user to enter the number size (say n), then ask to enter n numbers to calculate and display the arithmetic mean of all the numbers: #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(); }