what is the output of following c program
#include
int main() {
int x=1;
printf("%d %d %d", x, x++, ++x);
return 0;
}
and reason in detail
Answers
Answered by
0
First of all you haven’t included files correctly in the beginning after you include it correctly then you will get the output which is 113, as you see in the printf statement it consists of three parts one is printing value of x, then second part does postfix increment of x which increments value of x where first it will print value of x then increments it by one now value of x became 2, after that the third part will do prefix increment to value of x and it will become 3 then it prints the value of x. Hope that clears your doubts.
Similar questions