Write the function prototype for a function called Average A


Write the function prototype for a function called Average Age. The function takes 3 arguments of type integer and returns a double, the average of the 3 arguments.

Solution

Function prototype is necessary in order to inform the compiler about the function before starting the main method.

Few Points:

Here\'s the program,

double averageAge(int,int,int) //this is function prototype

void main(){

printf(\"The average age of 20,30,50 is %f\",averageAge(20,30,50));

}

double averageAge(int a,int b,int c){ // this is function defination

return (a+b+c)/3;

}

 Write the function prototype for a function called Average Age. The function takes 3 arguments of type integer and returns a double, the average of the 3 argum

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site