C-18-Q052mediumsingle_mcq
If the program forgot to write count=count+1, what would happen?
If the program forgot to write count=count+1, what would happen?
- aThe sum becomes 0
- bThe loop runs forever (infinite loop)
- cThe sum becomes 100
- dA NameError is raised
ব্যাখ্যা
Without count=count+1, the counter never changes, so the condition count<=100 stays true forever. This produces an infinite loop because the exit condition is never reached.