214k views
4 votes
Suppose you wrote a program that you suspect contains an infinite loop because it keeps running for several minutes with no output and without ending. what could you add to your program to help you discover the origin of the problem?

1 Answer

6 votes
Print the value of the variable[s] that the loop is relying on.
User Alireza Naghizadeh
by
6.6k points