Wednesday, 5 February 2014

Program to find Sum and 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 = %f", sum);
    printf("\nAverage = %f", avg);
}

No comments:

Post a Comment