Programming In Java · Instructor: Prof. Debasis Samanta
Write a Java program to check if a given integer is even or odd. Print "Odd" if odd and "Even" if even. NOTE: The code you see is not complete. Your task is to complete the code as per the question. Think of it like a programming puzzle. (Ignore presentation errors for this and all future programming assignments) ("passed with presentation error" means you will get full marks)
// Reference solution (Java)
// Check if the number is even or odd
if (number % 2 == 0) {
System.out.print("Even");
} else {
System.out.print("Odd");
}