Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I thought b would have new value for each loop as b-- is there and that would mean the loop would be smaller every time, and that would be the same as for the first block of code... so in this case the b-- does nothing, and b still have the same value for every loop? Commented Mar 23, 2017 at 10:04
  • b will start every time at value 4, but the loop will be smaller because the condition b >= a will be false earlier, with the increase of a from the first for loop. Commented Mar 23, 2017 at 10:07
  • I was pretty confused as the b-- is there but the value of b stays the same through out the loop, so now i know that it does not change the value of b. Thanks! Commented Mar 23, 2017 at 10:14
  • I edited my post to make it more clear: the value of b does change during the loop in which it is used as index due to the b-- expression. It will always start at value 4 and will stop depending on the value of a. Commented Mar 23, 2017 at 10:17