Discuss the advantage of looping with the help of an example.
Answers
Answered by
0
Loops help in NOT writing the same code again and again, if you want something to happen again and again.
Let’s say i want you to count to 100 and i told you that you can add 1 to the previous number and you have to start from 1. Then i ask you what is the next number, you’ll tell me the number +1, then again i asked you, what’s next number, now saying each time that add one number to previous number up to 100 is tiresome. So, a better and easy way you suggested was just repeat this process of adding one to the number until we reach 100.
thank you
#chetan2222
Let’s say i want you to count to 100 and i told you that you can add 1 to the previous number and you have to start from 1. Then i ask you what is the next number, you’ll tell me the number +1, then again i asked you, what’s next number, now saying each time that add one number to previous number up to 100 is tiresome. So, a better and easy way you suggested was just repeat this process of adding one to the number until we reach 100.
thank you
#chetan2222
Similar questions
English,
7 months ago
History,
7 months ago
Science,
1 year ago
Science,
1 year ago
CBSE BOARD X,
1 year ago