What is the output of the following C code? int main () { int x = 5; printf("%dn", x++); return 0;?

  • AUndefeated behavior
  • B0
  • C5
  • DNone of these
Show answerHide answer

Correct answer C

X = 5 print f("%dn", x++) → post-increment, so 5 is printed first, then x becomes 6 Output: 5.