(Solved):How to do loop termination by user query? View Answer…

 

Question

How to do loop termination by user query?

 

EXPERT ANSWER

The execution of a loop can be terminated using the following three methods:

Using a loop iterator: It will track the number of iterations and end the loop when the last value will be encountered.

Implementing User query: Here the program will ask to input the user’s choice stating if the program needs to be continued. The loop body will

Scroll to top