Multiple choice

(a) Associativity of “COMMA” is L à R. (b) Associativity of printf function is R à L. Which of the above is/are TRUE?

  1. (a)

  2. (b)

  3. Both (a) and (b)

  4. None of these

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

The comma operator evaluates operands from left to right. While the C standard does not define the evaluation order of function arguments, many compilers evaluate printf arguments from right to left to handle variable argument lists.