Whenever I forget to increment 'j' and hit run it becomes an infinite loop so what can we do to break the infinite loop in turbo c if I don't have the option of 'Break' on my keyboard?
what process we can follow in that scenario to break the running infinite loop in turbo c ?
Haha, You have to face it. The only way out is
Teach your fingers to keep clicking Ctrl + S every now and then so that your code is saved, progressively.
When Struck in infinite loop, the only ways getting out are:- a. Terminating
Turbo C++application directly. b. TerminatingTurbo C++application from Task Manager.d. Pressing Ctrl + C or Ctrl + Z continuously may sometimes help, but not gauranteed.
Always, have an
ifblock in a loop as a last statement to remind you that you need to check for condition before continuing the loop. You may also consider usingforloop instead when you are sure at what point you need to teminate the loop and progress further.