Operator priority | Sololearn: Learn to code for FREE!

0

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

0

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

0

the first gives 30 as answer

0

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

0

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..

-1

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