ICSE Class 10 Computer Applications
Question 7 of 30
Solved 2023 Question Paper ICSE Class 10 Computer Applications — Question 7
Back to all questionsinfinite
Reason — The given loop is an example of infinite loop as for each consecutive iteration of for loop, the value of i will be updates as follows:
| Iteration | Value of i | Remark |
|---|---|---|
| 1 | 5 | Initial value of i = 5 |
| 2 | 3 | i = 5 - 2 = 3 |
| 3 | 1 | i = 3 - 2 = 1 |
| 4 | -1 | i = 1 - 2 = -1 |
| 5 | -3 | i = -1 - 2 = -3 and so on... |
Since i will never be '0', the loop will execute infinitely.