+1

increment a loop

why is that when you use x++ in the for-loop during incrementing gives a different result unlike using x+1.

9/12/2019 5:43:08 PM

victorYegon

3 Answers

New Answer

+1

x+1 doesn't increase the value of the variable x. ++x does. So when your loop depends on x increasing, the first method wouldn't give you what you want.

0

Can you post an example?

0

x+=1 increments the loop