Find average of three numbers in c

 #include<stdio.h>

float  average(int a, int b, int c);

int main()

{

    int a, b, c;//it is completely different from below a b c 

    printf("Enter the value of a\n");

    scanf("%d", &a);

   

    printf("Enter the value of b\n");

    scanf("%d", &b);

   

    printf("Enter the value of c\n");

    scanf("%d", &c);

   

    printf("The value of average is %f", average(a, b, c));

   

return 0;

}


float average(int a, int b, int c){

float  result;

result = (float)(a + b + c)/3;

return result;

 

}

Comments

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c