Search This Blog

Tuesday 11 December 2012

Precedence of operators in C++

Order of execution within a statement is called Precedence.
For Example: 2+2 % 2 gives 2 NOT 0. How did I come to know?
What will happen first is predefined according to the picture below:


 Link to view this image: http://i.imgur.com/lffHR.jpg
OR goto http://en.cppreference.com/w/cpp/language/operator_precedence

2 comments:

  1. The image is not clear sir can u please add a clear image???

    ReplyDelete