Question

What do you see as the primary reason to use a for loop? What is one...

What do you see as the primary reason to use a for loop? What is one of its limitations? In those situations, is there another type of loop that would be a better choice?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

For loop is a control flow statement that allows the code to be executed repeatedly, when the number of iterations are known we typically use for loop.

Limitation : When the number of iterations are not known we should not use for loop.


Better Choice
While Loop should be used when the number of iterations are not known and it executed till a particular condition is met.


Thanks, let me know if you need more details

Add a comment
Know the answer?
Add Answer to:
What do you see as the primary reason to use a for loop? What is one...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT