If the question says... "user can enter input up to five times" - does that mean you use a "for loop" since you know the # of times? or do you just use a "while loop" please help. thanks.
justinlake888 0 Newbie Poster
Recommended Answers
Jump to PostA loop's a loop. It doesn't matter how you do it. It's entirely equivalent. No matter which you choose all should produce the same five-time iteration that you want. I'd use
for
but awhile
would work too.
Jump to PostUse whichever makes more sense. In this case it's a counted loop, which is what the for loop syntax was designed to handle.
All 8 Replies
twomers 408 Posting Virtuoso
Narue 5,707 Bad Cop Team Colleague
Denniz 103 Posting Pro in Training
justinlake888 0 Newbie Poster
RaiTsu 0 Newbie Poster
justinlake888 0 Newbie Poster
twomers 408 Posting Virtuoso
Sci@phy 97 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.