1.

How do we break from an infinite loop without keeping a break statement within the loop?(a) Press Ctrl+C(b) Press Ctrl+Z(c) Loop won’t be terminated(d) Press Ctrl+XThe question was asked during an online interview.My question comes from Loops in chapter Interacting with MATLAB of MATLAB

Answer»

Right answer is (a) Press Ctrl+C

Best EXPLANATION: If we begin an infinite LOOP, by choice or as a silly mistake, we can TERMINATE the loop manually if we forget to introduce a break STATEMENT as necessary. We can choose to press Ctrl + C and the loop will get terminated at the same INSTANT.



Discussion

No Comment Found

Related InterviewSolutions