5.7.3.5. Infinite Loops

A loop does not always stop. For example, if n = 10 then

  i = 0;
  while(i != n)
  {
    System.out.println(i);
  }
will never end. If you are using Linux and you suspect that your program is in an infinite loop, use control-C to stop it.


Exercises

  1. How can you stop a program that appears to be in an infinite loop in Linux? Answer