This is what I have so far but I know it is not right I am wrong....I need help.
ID: 3626679 • Letter: T
Question
This is what I have so far but I know it is not right I am wrong....I need help...its a loop and needs to have this in it somehow::for (x=100; x<=200; x++)
{
if (x%5==0)
print - yes x is evenly divisible by 5....system.out.println...
if(x%6==0)
print - yes x is evenly divisible by 6....system.out.println...(i cant figure it out??)
here it is::::
public class Test {
public static void main(String[] args) {
boolean b6, b5;
String s = "";
int iTotal = 0;
for (int i=100; i <= 200; i++) {
b5 = (i % 5) == 0;
b6 = (i % 6) == 0;
if ((b5 || b6) && (!(b5 && b6)) ) {
iTotal++;
s = s + " " + i;
if (iTotal == 10) {
System.out.println(s);
iTotal = 0;
s = "";
}
}
}
if (s.length() > 0)
System.out.println(s);
}
}