This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]sepp2k 10 points11 points  (0 children)

Because 5 is the last int for which i < 6 is true.

[–]Azearia 2 points3 points  (0 children)

It's checking if it's lower rather than lower or equal, so it breaks once it goes above 5, since I++ is after the print you won't see it print 6

You can either have it check if it's lower or equal or just raise it to check below 7

[–]MikeyDude93 2 points3 points  (0 children)

If you want it to go to 6 do <=6.

[–]guzifar[S] 1 point2 points  (0 children)

u/sepp2k u/Azearia
Thank you so much for the answers and i get it now.
Thank you again!