Average of 3 numbers program in C

C programming tutorial, we will learn how to find the average of 3 numbers with the help of C programming language. What is an average of Numbers:   The Sum of all the numbers divided the number is said to be the average of the numbers. In short, It is SUM/COUNT.

c PROGRAM TO FIND THE AVERAGE OF THREE NUMBERS:

#include<stdio.h>
 int main()
 {
 int number1,number2,number3;//declaring the 3 numbers.
 float average;
 printf("Enter first number\n");
 scanf("%d",&number1);
 printf("Enter second number\n");
 scanf("%d",&number2);
 printf("Enter third number\n");
 scanf("%d",&number3);
 average=(number1+number2+number3)/3;//sum/count
 printf("Average is %f",average);//printing the value of the avaerage
 return 0;
 }

The above program helped you to learn to find the average of 3 numbers using C programming language.

Leave a Reply

Shopping cart