Q. | Point out the error, if any in the following program. main()
{
int b;
b=f(20);
printf("%d",b);
}
int f(int a)
{
a>20 ? return(10) : return(20);
}
|
|||||||
|
Answer: | Option D | |
Explaination: | Return statement cannot be used as shown with the conditional operators. Instead the following statementmay be used. return(a>20 ? 10 : 20). |
Discussion
Your Comments Goes here... |
Name | Discussion |
---|