478 views
2 votes
2 votes
main(int argc, char *argv[])

{(main && argc) ? main(argc-1, NULL) : return 0;}

 

a. Runtime error.

b. Compile error. Illegal syntax

c. Gets into Infinite loop

d. None of the above

1 Answer

1 votes
1 votes

Here, usage of ternery operators is having illegal syntax . As return which is a statement line should never be used in ternary operators . 

Syntax is :==

(cond.) ? Expression 1 : expression 2

Return is not a expression.

Moreover, exp 2 data type should also be implicitly convertible to exp 1, which cannot be done here..

Return (( a > b ) ? a : b) is valid syntax..

No related questions found