what is loop? What is the need of it?
Answers
WHAT IS A LOOP ?
⇒ A loop is a part of a program that iterates a value and repeats the iteration if a particular condition is satisfied .
⇒ A loop is the sequence of repeatation of functions or tasks
⇒ You can also say that loop is a sequence or repeatation of instructions
NEED OF A LOOP
⇒ A loop makes our task easier
⇒ Imagine that you are taking an input of 1,000 elements . You can write the statement in 3 lines with a loop but if you would not have used then you had to use 1,000 lines for doing the same task.
⇒ A loop satisfies certain conditions and gives us the desired output .
⇒ A loop helps in handling an array
⇒ A loop performs useful mathematical operations
Hope it helps :-)
____________________________________________________________________