When I got to the section on the addition of Continue to the “for loop” I started playing with different number in the "if (i % 3 == 0) and found that if you use a number that is divisible by the answer (5 goes in evenly to 10) to the “break” section it ruins the results for the entire code string. Does anyone know the reason this happens? code that is breaks is below
#include <stdio.h>
int main(int argc, const char * argv[])
{
int i;
for (i = 0; i < 12; i++) {
if (i % 5 == 0) {
continue;
}
printf(“Checking i = %d\n”, i);
if (i + 90 == i * i) {
break;
}
}
printf(“The answer is %d.\n”, i);
return 0;
}