public class Test1 {
public static void main(String[] args) {
for (int i = 104; i <= 196; i++) {
if ((i % 5 == 0) && (i % 4 == 0)) {
System.out.print("");
} else if ((i % 4 == 0)...
Type: Posts; User: MrLowBot
public class Test1 {
public static void main(String[] args) {
for (int i = 104; i <= 196; i++) {
if ((i % 5 == 0) && (i % 4 == 0)) {
System.out.print("");
} else if ((i % 4 == 0)...
So what i get is:
i = 0 mod 4 = 0
i = 1 mod 4 = 1
i = 2 mod 4 = 2
i = 3 mod 4 = 3
i = 4 mod 4 = 0
i = 5 mod 4 = 1
i = 6 mod 4 = 2
No i do not.
And no it isn't in the spirit of the assignment :/
So i feel rather stuck atm.
What i think it should do.
1. The program should know that it only can choose from 100 to 200.
2. It should be able to print out every value from 100 to 200 (which it can if we begin from scratch)....
Okay so i followed both of your steps.
I can get the numbers that i am searching for!
However before i did that i took, ex, 104 / 4 = 26.
And then the highest which would be 195 / 5 = 39.
I...
I meant "number".
I know that it doesn't change. Trying to figure it out with modulus rn.
The assignment was that i needed numbers that go from 100 to 200 or 200 to 100 that devide by 4 or 5 but...
public static void main(String[] args) {
int number = 0;
for (int i = 200; i > 100; i--) {
i = i / 4 ^ 5;
i = number;
}
System.out.println(number);
Nothing.. i am stuck and i don't know what to do xD
So i wanted to write a code that, when it starts, prints out numbers between 100 and 200 that can be devided between 4 or 5 but not both!
Really hard to figure out how i should go about doing so.
...