What is looping? Describe the types of looping with examples.
Answers
Answered by
3
The looping is used when a set of instructions is to be checked multiple times until a condition is satisfied.
- In programming there is a need for the running of codes more than one time, in order to meet a condition result is true.
- In that cases instead of writing instructions repeatedly loop statements can be called so that time will save and it makes the program easy.
- The looping can be categorized as exit control and entry control.
- Entry controlled loop: The condition which needs to be satisfy checked at the beginning of the loop, and codes will execute only if the condition is true. While loop belongs to this type.
- Exit controlled lop: When the condition to check is placed after the set of instructions is exit controlled loop. The condition will check after the running of the codes. The do-while loop comes under this category.
Similar questions