c++ doubt

jainprateek2000's Avatar, Join Date: Aug 2009
Newbie Member
a=5,c are integers
d=1.5 is floating type
evaluate
c=(a++)*d+a
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
c=(5*1.5)+6
0
Gene Poole's Avatar, Join Date: Nov 2009
Contributor
I believe it should be 12. The a++ is superfluous to this expression as it won't be evaluated until after the full expression (after the semicolon) so it has no affect on the outcome; however, I seem to recall from the C++ standard that the behavior of an expression involving a postfix or prefix operator and the operand of those operators in the same expression is undefined.