Trying to create a program that asks the user to input a number between 20 and 100. After the number has been entered. The program will divide the entered number by 12. The program will then say if the result of the division is even or odd. (example: the remainder of 35 divided by 12 is 11, and it is odd.)
I have started the program but cannot figure out the division part.
import java.util.Scanner;
public class Chpt3_Project {
public static void main (String [] args) {
// Create a Scanner object
Scanner sc = new Scanner(System.in);
// Prompt the user to enter an integer value between 20 and 100.
int input;
do {
System.out.print("Enter a number between 20 and 100: ");
input = sc.nextInt();
if (input < 20 || input >= 101) {
System.out.println("Invalid number input!");
}
} while (input < 20 || input >= 101);
//Divide result by 12 and show if even or odd
}
}