+ 4
simce it says i = 5 and then while true i = i-1 doesent that mean that when i =4 it wont be 5 and therefore false?
3 Respuestas
+ 6
Could you show us the code?
If the code is like this:
i = 5
while(True)
i = i - 1
This will run "forever" because the while condition will never become false. This while loop needs a break statement.
0
thanks
- 1
No. The loop will return true forever if the above code is true