Correct the following declaration of function f of type floa
Correct the following declaration of function f of type float with parameters a and b of type int: float f (int a, b);
Solution
answer is : float f(int a,int b);
must specify the datatype before variable
here is sample code is c:
#include <stdio.h>
float f(int a,int b); // declaration
int main()
{
f(2,5);
return 0;
}
float f(int a,int b)
{
printf(\"%d %d\ \",a,b);
}
Output:
2 5
