Program to find average of 3 numbers

 Average of n numbers= sum of all numbers/ total number

#include<stdio.h>
void main()
{
int a,b,c;
float avg;
printf("Enter three numbers:");
scanf("%d %d %d", &a, &b, &c);
avg = (a+b+c)/3;
printf("Average= %f", avg);
}

Post a Comment

0 Comments