1,402 views

1 Answer

Best answer
2 2 votes

Undefined Behavior.

Compile with gcc with the following command :

gcc filename.c -save-temps

Now look intro your directory where you have saved this c file. Open the filename.i file. It would be large preprocessed file. Go to the end of the file and there you can see how your macros are being replaced with b++.

a = (b++*b++*b++);

This creates undefined behaviour. 

You can execute your program here:

http://codepad.org/

Output:27,6

http://ideone.com/

Output:60,6

https://gateoverflow.in/62411/what-is-the-output

• selected by
Position:
Show:

Related questions

0 0 votes
1 1 answer
806
806 views
Ankush Tiwari asked Aug 20, 2016
806 views
#include<stdio.h int main() { char *p1="xyz"; char *p2="xyz"; if(p1==p2) printf("equal"); else printf("unequal"); }Output is equal how??? please explain
2 2 votes
1 answers 1 answer
836
836 views
Registered user 7 asked Aug 19, 2016
836 views
#include<stdio.h #include<stdlib.h int main() { int p=9; printf("%d %d",p++,++p); } how it executed and also how printf function executed left to right or right to left?
1 1 vote
2 answers 2 answers
2.0k
2.0k views
Sanjay Sharma asked Nov 17, 2016
1,954 views
1 1 vote
0 0 answers
867
867 views
PEKKA asked Nov 18, 2016
867 views
What are sequence Points ....?A sequence point defines any point in a computer program's execution at which it is guaranteed that all side effects of previous evaluations...