average function
#include <stdio.h>
float average(int a, int b, int c);
int main(){
int 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:% 0.2f",average(a,b,c));
return 0;
}
float average(int a,int b, int c)
{
return (float)(a+b+c)/3;
}
Comments
Post a Comment