0

I am a beginner in C.I have been practicing some c programming question online,then I came across a pre increment and post increment question.I searched about it all over internet but doesn't find suitable explanation.

main(){
 int d=1;
 printf("%d",++d + d++);
 printf("%d",d++ + ++d);}

Link for the question :http://www.sanfoundry.com/online-c-test-increment-decrement-operators/ This program is giving different output.In java,It is giving 4.In C, It is giving 5. Can someone explain how this evaluating ?

too honest for this site
  • 12,050
  • 4
  • 30
  • 52

0 Answers0