Write a C program in the C programming language to find the average of three numbers. Below is the solution of the program –
/*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); av=(a+b+c)/3.0; printf("\n Average of three numbers is \t %f",av); getch(); }
Input-
Enter three numbers to find their average – 23 64 33
Output –
Average of three numbers is – 40.000
y d usage of/t is necessary
/t is used to give a TAB space(1 tab space= 4 times space bar)
#include is missing…
include conio.h missing
#include. . . . . .1 void main (). . . . . . . . . . .2 {. . . . . . . . . . . . . . . . . . . . . 3 int x, y, z, ave; . . . . . . . 4 scanf(“%d %d %d”, &x, &y, &z); . . . . . . . . . . . . . . 5 ave = (5+2+9)/3; . . . . .6 printf(“the average is =%d”, ave); . . . . . . . . . . . . 7 }
This is awesome result. Thanks
I
t helps me.Thank u.
\t ?what is the usage
thanks for help me
thank you for information
Thanks for this help