Translate

Thursday, June 4, 2015

Write a C program that calculate the average of three integers. Input the values from user.



#include<stdio.h>

void main()

{
    float a,b,c,avrg;

    printf("A?  ");
    scanf("%f", &a);
    printf("B?  ");
    scanf("%f", &b);
    printf("C?  ");
    scanf("%f", &c);

    avrg= (a+b+c)/3;

    printf("%f", avrg);

}


Download source code

0 comments:

Post a Comment