Answer & Solution
The correct answer is D. Nothing is printed.
In the given code, the if
statement condition consists of multiple expressions separated by commas (,
). The comma operator evaluates each expression from left to right and returns the result of the last expression.
In this case, the expressions a
, b
, x
, and y
are used as the condition. Since they are non-zero values (10, 20, 1, and 0 respectively), the condition is considered true. However, the comma operator only returns the result of the last expression (y
), which is 0 (false).
Since the condition evaluates to false, the code block within the if
statement (printf("EXAM");
) is not executed, resulting in nothing being printed.