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 trialName:GoogleSearch orJonathan Sum
5,039 PointsWhich kind of loop runs a set number of times?
what is the answer? could some1 explain it to me? Thank you!
2 Answers
Steven Parker
231,261 PointsIt's a slightly tricky question, but there are only two choices.
The trickiness is because any loop can be made to run a set number of times, but one of the two choices is a better answer because it takes parameters that make using it this way easier.
Specifically, both types take a conditional expression, but only one also takes an initialization expression and and iterating expression. I'll bet that one is the right answer.
Name:GoogleSearch orJonathan Sum
5,039 PointsName:GoogleSearch orJonathan Sum
5,039 Pointsthe question was asking is that while loop or for loop ,so which one is?
Ashish Shah
1,468 PointsAshish Shah
1,468 PointsPlease explain with answer!