Q. What will be the output of the following C code?
Code:#include <stdio.h>
void main()
{
int x = 10;
int y = x++ + 20;
printf("%d,%d",x,y);
return 0;
}
β
Correct Answer: (A)
11,30
Explanation: In the above code, we are using a post-increment statement (x++), post-increment increases the value after evaluating the current expression. Thus, the value of y will be 30 and then x will be 11.