An infinite while loop happens when the condition to exit never becomes false, often because we forget to update the variable inside the loop. In school programs, this commonly occurs with a simple counter where we write 'while x > 0' but forget to include 'x = x - 1' in the loop body. I see this in my bootcamp when we are tired after a long day—bas, we are thinking of roti and sabzi, and the mind misses the small step. But isn't it true that the smallest oversight can keep the program running forever, just like waiting for a phone call from a loved one?
#exams#study
Jump in to reply — no account needed.