Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![gabriel wambua](https://secure.gravatar.com/avatar/eeddd9490b9a1766e2f56dcf8c0d3f79?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
gabriel wambua
5,061 PointsHi this is a question with regards to loops specifically while loops
Hi this is a question with regards to loops. I just realized that if I forget to do a ++ incremental in a while loop it will go on forever during run time.
My question is why is the incremental bit important?
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsThe loop runs until the condition being tested in the "while" becomes false. If nothing inside the loop changes the condition, it will never stop.
I assume the increment you refer to was being applied to a variable that is being tested in the "while" expression.
gabriel wambua
5,061 Pointsgabriel wambua
5,061 PointsI agree...but why is it important to place the ++ signs after the loop has run? Which real world scenario would this be relevant for? I an just trying to wrap my head around this.
Steven Parker
230,688 PointsSteven Parker
230,688 PointsThe increment happens each time through the loop, and the value eventually becomes larger than what it is being compared to and the loop stops.