+ 1
Two different code but the same result , why?
3 Answers
+ 4
Do you think they should have a different result? If so, why?
+ 2
I think you are asking why it gives the same outcome regardless of using prefix or postfix incrementing at the end of the for() loop.
In this context the values of i and j are not used at the time they are incremented. They are just incremented. Regardless of incrementing before or after evaluation or use, in the end they both are still incremented.
You might want to review C++ lesson 9.1 prefix and postfix incrementing
https://www.sololearn.com/learning/1610/
0
Different codes can yield the same outputs.
Please link your codes.