Hello again, I am having problems with writing a simple program to see if a number is divisible by 6.
public void run() { println("This program will display all numbers divisable by"); println(" 6 between 1 and 100."); int x =1; boolean divide =(x%6==0); while (x<100) { if (divide) { println(+x+" Is divisable by 6."); } else { println(+x+"Is not divisable by 6"); } x++; } }
Any help would be appreciated, it is telling that every number is not divisable by 6???? Thanks