Answers for "java boolean odd number"

0

java boolean even number

for (int i = 0; i < 5; i++) {
    System.out.println("Enter an integer.");
    x = in.nextInt();
    if (x % 2 == 0) {
        even++;
        System.out.println(x + " is even.");
    }
    if (x % 2  == 1) {
        odd++;
        System.out.println(x + " is odd.");
    }
Posted by: Guest on March-03-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language