C Program to Calculate Arithmetic Mean

« Previous Program Next Program »

Calculate Arithmetic Mean in C

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 perform addition, then make a variable responsible for average and place addition/size in average, then display the result

C Programming Code to Calculate Arithmetic Mean

Following C program ask the user to enter "How many number he/she want to enter", then ask to enter all the numbers to calculate and display the arithmetic mean:

/* C Program - Calculate Arithmetic Mean */
void main()
	int n, i, arr[50], sum=0;
	printf("How many number you want to enter ?\n");
	printf("Enter %d Numbers :",n);
	for(i=0; i<n; i++)
	int armean=sum/n;
	printf("Arithmetic Mean = %d",armean);

When the above c program is compile and executed, it will produce the following result:

c program arithmetic mean

Same Program in Other Programming Language

You may also like same program in other programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test