+ 3
What is "break" used for in a loop?
What is "break" used for in a loop?
4 Answers
+ 3
I take it in c++, it means "stop the code here" you can use it with the loops or switch statement. So if you trying to print numbers from 1-100 you can tell the program to stop in 80
Example
If (num == 80)
Break;
+ 3
Thanks, Raed Matti!
0
You are welcome
0
To terminate the loop