Tuesday, 25 February 2014

Tagged Under:

Program to calculate to average of three number

Share















Source Code

/*C program to find the average of three numbers*/

#include<stdio.h>
int main()
{

float a,b,c,av=0;
 
printf("Enter any three numbers to find their average \n");//Enter 3 number
scanf("%f%f%f",&a,&b,&c);
 
av=(a+b+c)/3.0; //calculate average
 
printf("\n Average of three numbers is \t %f",av);//result store in variable av
return 0;
}

Output


0 comments:

Post a Comment

Contact Us

Want to ask anything? Be our guest, give us a message.

Name Email * Message *