The answer is k will print 5, but I am just learning loops and don't see how. Would it not go, j=0,k=0,j=1,k=1,j=2,k=2,etc, until j=5 and then k remains at 4? Sorry if this is a silly question or out of place but would appreciate the clarification thanks!

Re: Loop Help

The best solution would be to step through the code in your head, writing down the value of j and k with each loop. I believe that if you do this, you'll answer you're own question. If not, please feel free to come back and let us know what you've found, or what is still confusing.

Re: Loop Help

Yes, but k++ increases the value when k is next encountered correct? It doesn't increase K at the line k++ but at the next appearance of k?

No it increments k right there at that spot.

I think I see what your problem is. You're thinking of the difference between ++k and k++, right? Well this difference doesn't matter here at all since either form of this expression will work the same (try it yourself and see). The only time that this matters is when you're using the k at the very same time that you're incrementing it. For e.g.,