Ideas
100-200 means that the cycle is required and cannot be divisible by 3, that is, the remainder of 3 is not equal to 0.
Method 1
#include<stdio.h>
int main()
{
int i;
for(i = 100;i<=200;i++)
{
if(i%3==0)
{
continue;
}
printf("%d",i);
}
return 0;
}
Method 2
#include<stdio.h>
int main()
{
int i;
for(i = 100;i<=200;i++)
{
if(i%3!=0)
{
printf("%d ",i);
}
}
return 0;
}
Output result
Replace the continue in method 1 with break
#include<stdio.h>
int main()
{
int n;
for(n = 100;n<=200;n++)
{
if(n%3==0)
{
break;
}
printf("%d ",n);
}
return 0;
}
The difference between continue and break
continue ends this (this trip) loop
break ends the entire loop