I already asked a question regarding evaluation of expression in this forum like int y,x=3; y = x++ + x++ ; i got reply that the above statement would be interpreted as y = x+x; x = x+2; i.e the effect of post fix takes place only after the statement , i then agreed it . it perfectly worked with the below code int y=0,x=3; y = x++ + x++ + ++y; i using the above method did y = x +x + ++y; x =x +2; and got y = 10 as output , i then again applied same method for below code, int y , x = 3; y = x++ + ++x; i thought the expression would be evaluated as , y = x+ ++x; x = x+2; and y would be 7 , but when i ran the code it got 8 as output , can anyone please explain ...
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.