Operator priority | Sololearn: Learn to code for FREE!


Operator priority

how it works.... a=5; a=a++*a++; cout<<a; a=5; a=++a*++a; cout<<a; a=5; a=++a*a++; cout<<a;

2/18/2018 1:42:49 PM

Ankit Rathore

5 Answers

New Answer


It will produce undefined behaviour. ++ -- shouldn't be used more than once per sequence point


the first gives 30 as answer


its working... we can use it in this way


i trust you. only i am asking...because my compiler gives me the result...my compiler name is c4droid.... and this question is asked in sololearn..


Well... if you don't trust me then go on and spam your increment/decrement operators. Have fun finding these bugs you will most likely produce if you do it. http://en.cppreference.com/w/cpp/language/eval_order