+ 1

Cant understand break command in c language properly

. #include <stdio.h> int main() { int num = 5; while (num > 0) { if (num == 3) break; printf("%d\n", num); num--; } return 0; }

22nd Jun 2018, 4:06 PM
Nikita Desale
Nikita Desale - avatar
1 Odpowiedź
+ 6
https://www.sololearn.com/learn/2388/?ref=app When a break statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop. If you are using nested loops, the break statement will stop the execution of the innermost loop and start executing the next line of code after the block.
22nd Jun 2018, 4:09 PM
Scooby
Scooby - avatar