Westonci.ca is the premier destination for reliable answers to your questions, provided by a community of experts. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.
Sagot :
Answer:
Use a for loop when you know you want to make 10 passes through a loop
Use a while loop when you want to continue passing through a loop until a condition is met
Explanation:
Let us first clear that when do we use for loop and when do we use while loop.
For loop is used when the programmer already knows the number of repetitions.
While loop is used when the number of iterations are not known but the condition has to be used to determine the number of iterations.
Hence,
Use a for loop when you know you want to make 10 passes through a loop
Use a while loop when you want to continue passing through a loop until a condition is met
We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.