C Program to Find the Average of Three Numbers
Average is found out by adding all the numbers and dividing it by the total number of numbers.
- // C program to find the average of three numbers
-
- #include<stdio.h>
- void main()
- {
- float a,b,c, av=0;
- printf("Enter any three numbers to find their average \n");
- scanf("%f%f%f",&a,&b,&c); // taking input as float
- av=(a+b+c)/3.0; // adding and dividing simultaneously
- printf("\n Average of three numbers is \t %f",av); // printing the result
- getch();
- }
Output

Solution not working or have any suggestions? Please send an email to [email protected]
Download Android App