Why can\'t we use return keyword inside ternary operators in C, like this:
sum > 0 ? return 1 : return 0;
The return statement is used for returning from a function, you can't use inside ternary operator.
(1==1)? return 1 : return 0; /* can't use return inside ternary operator */
you can make it like
return (1==1) ? 1 : 0;
The syntax of a ternary operator follows as
expr1 ? expr2 : expr3;
where expr1, expr2, expr3 are expressions and return is a statement, not an expression.