1// The code will print your number 10 times if x <= 100
2
3int x = 120;
4for (int i = 0; i < 10; i++)
5{
6 if (x > 100)
7
8 // Note: if multiple for loops: breaks the superficial one
9 break;
10 else
11
12 printf("%i\n", x);
13}
1#include <stdio.h>
2
3int main () {
4
5 for (int i = 1; i <= 100; i++)
6 {
7 if (i == 5)
8 {
9 //use break, same as c#
10 break;
11 }
12 }
13
14 return 0;
15}