Question
#include<stdio.h>
int f(int a)
{
a > 20? return(10): return(20);
}
int main()
{
int f(int);
int b;
b = f(20);
printf("%d\n", b);
return 0;
}
Point out the error in the program
#include<stdio.h>
int f(int a)
{
a > 20? return(10): return(20);
}
int main()
{
int f(int);
int b;
b = f(20);
printf("%d\n", b);
return 0;
}
Answer: Option C
Was this answer helpful ?
In a ternary operator, we cannot use the return statement. The ternary operator
requires expressions but not code.
Was this answer helpful ?
Submit Solution