Headlines
Loading...
C Program to calculate the average of 3 numbers

C Program to calculate the average of 3 numbers

C Program to calculate the average of 3 numbers 

# include<stdio .h="">
# include<conio .h="">
void main()
{
int a,b,c,total;
float avg;
clrscr();
printf("\nEnter 3 numbers:");
scanf("%d %d %d",&amp;a,&amp;b,&amp;c);
total=a+b+c;
printf("\n Total=%d",total);
avg=total/3;
printf("\n Average=%0.02f",avg);
getch();
}

*************OUTPUT**************

Enter 3 numbers:6
8
9

 Total=23
 Average=7.00</conio></stdio>
*** PLEASE checkout the Best deals from for top sites like Amazon, Flipkart etc ***