Check out example codes for "how to break a loop in c". It will help you in understanding the concepts better.

Code Example 1

// The code will print your number 10 times if x <= 100

int x = 120;
for (int i = 0; i < 10; i++)
{
	if (x > 100)
    
		// Note: if multiple for loops: breaks the superficial one
    	break;
    else
	
        printf("%i\n", x);
}

Learn ReactJs, React Native from akashmittal.com