Home > Back-end >  Write programs for [1100] can be divided exactly by 7 or 11, but cannot be divided exactly by 7 and
Write programs for [1100] can be divided exactly by 7 or 11, but cannot be divided exactly by 7 and

Time:04-14

Why I output is 1 2 3 4 5 6 7 8
9 10...
#include
#include
Void main ()
{
Int I, n=1;
for(i=1; i<=1000; I++)
{
If ((I % 7==0 | | I % 11==0) & amp; & (I % 7!=0 & amp; & I % 11!=0))
continue;
Printf (" % 5 d ", I);
If (n++ % 8==0)
printf("\n");
}
}

CodePudding user response:

Reference:
 # include & lt; Stdio. H> 

Void main ()
{
Int I, n=0;
for(i=1; i<=1000; I++)
{
If ((I % 7==0 & amp; & I % 11!=0) | | (I % 7!=0 & amp; & I % 11==0))
{
Printf (" % 5 d ", I);
n++;
If (n %==0 8) printf (" \ n ");
}
}
printf("\n");

}
  • Related