What will be the output of the following 'C' code? main ( )
What will be the output of the following 'C' code?
main ( )
{ int x = 128 ;
printf("\n%d", 1 + x++);
}
Show answerHide answer
Correct answer: (B) 129
Explanation
x++ is a post-increment, so the old value 128 is used in the expression and printf prints 1 + 128 = 129; x becomes 129 only afterwards.