10.(C)Average of three given integer number

 #include<stdio.h>


int main(){
    int a,b,c;
    float avg;
    printf("Enter the value of a,b,c \n");
    scanf("%d%d%d",&a,&b,&c);
    avg= (float)(a+b+c)/3;  // we have use float here to get the output in decimal
    printf("The average is %.2f",avg); // .2f for printing two decimal after integer

    return 0;
}

Comments