Differentiate between count-controlled
and loop event controlled loop.
class 11 python
Answers
Answer:
Event controlled loop
1.here we don't know how many times loop is going to work
2. An event changes loop expression to be evaluated from true to false.
3. Example: when we read the data loop expression may be evaluated to true.but,we encounter the end of the input.loop expression may be evaluated to false .
4.Sine series, palindrome, finding lcm and gcd are some of the examples for event control loop programs.
Counter controlled loop:
1.here we know how many times loop is going to work.
2. sum of n natural numbers, Fibonacci series these are examples for counter controlled loop programs.
Answer:
In the case of a counter-controlled loop, the number of loop iterations is known before the loop is executed, while in case of an event- controlled loop, it is determined while the loop is executing.
hope this answer may help you ☺️☺️