CProgram

Program to find Average of three Real Numbers

Write a C program to an average of three real numbers.

#include <stdio.h>
main()
{
float a, b, c, sum, avg;
printf(“\nEnter value of three numbers: “);
scanf(“%f %f %f”, &a, &b, &c);
sum = a + b + c;
avg = sum / 3;
printf(“\nSum = %.2f”, sum);
printf(“\nAverage = %.2f”, avg);
getch();
}

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

You may also like

Leave a reply

Your email address will not be published.

More in:C