Multiple choice

Find the error in the code assuming that preprocessor directives are correct. int fun (int val) {
val > 20? return(15): return(30); } void main( ) {
int fun( int );
int final;
final = fun (20);
printf("%dn", final); }

  1. There is no error and program will execute normally.

  2. Preprocessor directives are not used in the program.

  3. A function cannot be declared above main.

  4. Return statement should not be used with conditional operators.

  5. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

return keyword cannot be used with conditional operator or with ternary operator.