How do we break from an infinite loop without keeping a break statement within the loop?

Lan Anh

New member
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+X
 
Answer: a
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.
 

Tìm kiếm

Back
Top