i=0
while(i<10):
if(i==4):
break
print(i)
i=i+1
find output
Answers
Answered by
2
Required Answer:-
Question:
- Find the output of the given program.
Solution:
Corrected códe:
i=0
while (i<10):
if(i==4):
break
print(i)
i=i+1
Output:
0
1
2
3
Explanation:
- Initial value of 'i' is 0. After each iteration, value of 'i' is displayed and it's value is incremented by 1. If value of 'i' becomes 4, then the loop will be terminated by break statement.
For verification, check out the attachment ☑.
Attachments:
Similar questions