Write A Program To Check Whether A Number Is Even or Odd
Write A Program To Check Whether A Number Is Even or Odd
Solution
Import java.util.Scanner;
// Declaring Variables
Int num; // variable to store the input number
Boolean isEven; // variable to store whether the number is even or odd
Import java.util.Scanner;
// Declaring Variables
Int num1; // variable to store the first number
Int num2; // variable to store the second number
Int max; // variable to store the maximum number
System.out.print("Enter the first number: "); // prompt user to enter the first number
num1 = scanner.nextInt(); // read the user input and store it in num1
System.out.print("Enter the second number: "); // prompt user to enter the second number
num2 = scanner.nextInt(); // read the user input and store it in num2