Question
int f1(int a, int b)
{
return ( f2(20) );
}
int f2(int a)
{
return (a*a);
}
Will the following functions work?
int f1(int a, int b)
{
return ( f2(20) );
}
int f2(int a)
{
return (a*a);
}
Answer: Option A
#include<stdio.h>
int f1(int, int); /* Function prototype */
int f2(int); /* Function prototype */
int main()
{
int a = 2, b = 3, c;
c = f1(a, b);
printf("c = %d\n", c);
return 0;
}
int f1(int a, int b)
{
return ( f2(20) );
}
int f2(int a)
{
return (a * a);
}
Was this answer helpful ?
Yes, It will return the value 20*20 = 400
Example:
#include<stdio.h>
int f1(int, int); /* Function prototype */
int f2(int); /* Function prototype */
int main()
{
int a = 2, b = 3, c;
c = f1(a, b);
printf("c = %d\n", c);
return 0;
}
int f1(int a, int b)
{
return ( f2(20) );
}
int f2(int a)
{
return (a * a);
}
Output:
c = 400
Was this answer helpful ?
More Questions on This Topic :
Question 4.
Every function must return a value
....
Submit Solution