Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int x = 0; x < 100; x++) {
- boolean notZero = x != 0;
- int previous = x - 1;
- int and = x & previous;
- boolean isMultipleOfTwo = notZero && (and == 0);
- System.out.println(String.format("%d = %s", x, isMultipleOfTwo));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement