Description
At times, we want to repeat our code, so we use loop statements to control the number of iterations. Determine the best way to stop a loop from running infinitely and define the process used to verify that the loop is working correctly.
Explanation & Answer
a loop has three basic components; the starting condition, ending condition and an iterative to update some variable to check the loop condition at next iteration of loop.
Infinite loops can occur due to failure of any of above three conditions, specially ending condition. if ending or termination condition of the loop is not implemented correctly, loop goes into infinite iterations.
Termination condition is to check when to terminate the loop.
Apart from these conditions, working of loop can also be checked by debugging.
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
The Good Earth
by Pearl S. Buck
The Restless Wave
by John McCain
The Iliad
by Homer
12 Rules for Life
by Jordan Peterson
And Then There Were None
by Agatha Christie
Rules Of Civility
by Amor Towles
Big Little Lies
by Liane Moriarty
Their Eyes Were Watching God
by Zora Neale Hurston
Crippled America
by Donald J Trump