Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple C program-please explain output.

 
hitesh inception
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


output: 20

I could not understand why it prints '20' ? please explain it !
 
Anand Hariharan
Rancher
Posts: 272
C++ Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not try to understand code that is meaningless and/or has undefined behaviour.

Look up http://www.c-faq.com -- Section 3. All of it would make good reading, but 3.8, 3.2 and 3.11 would probably be the most relevant for you.

There is a (very) brief explanation by Stroustrup at http://www.stroustrup.com/bs_faq2.html#evaluation-order
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic