int answer; System.out.print("Enter a number: "); answer = Keyboard.readInt(); if (answer < 5) if (answer == 1) System.out.println ("Hello"); if (answer = 0) System.out.println("There"); else System.out.println("You"); if (answer > 2) System.out.println("What's"); else System.out.println("Up");
int count1 = 0; int count2 = 0; int num = 2157; while ( num != 0) { if (0 == num % 2) count1++; else count2++; num = num / 2; }