Give any one example of infinite loop
Answers
Answered by
1
Answer:
A loop is used for executing a block of statements repeatedly until a particular condition is satisfied. Example, when you are displaying number from 1 to 100 you may want to set the value of a variable to 1 and display it 100 times, increasing its value by 1 on each loop iteration.
Answered by
0
When a condition never becomes false, the program enters the loop and keeps repeating that same block of code over and over again, and the loop never ends. The following example shows an infinite loop: a = 1 while a==1: b = input(“what's your name?”) print(“Hi”, b, “, Welcome to Intellipaat!”)
Similar questions