what are the advantages of using for loop
Answers
Answered by
5
Hey!!
Here is your answer:-
❇️ 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.
❇️ Simply, you did the same thing in one sentence. That’s the power of loop. It can iterate many time the same code so you don’t have to write again and again.
Hope... It... Helps... You...❤️
Here is your answer:-
❇️ 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.
❇️ Simply, you did the same thing in one sentence. That’s the power of loop. It can iterate many time the same code so you don’t have to write again and again.
Hope... It... Helps... You...❤️
prisha20DK:
hii Prachi
Similar questions