Why can\'t we use return keyword inside ternary operators in C, like this:
sum > 0 ? return 1 : return 0;
Just by looking at the syntax you should know that an statement cannot be used in an expression. What you want can be achived by doing:return sum > 0 ? 1 : 0;
return sum > 0 ? 1 : 0;