π Dive into the world of Java with this fun and simple program that solves the age-old mystery: Is it Even or Odd? This beginner-friendly project uses user input and conditional logic to unveil the nature of any number you enter. Perfect for first-time Java explorers!
public class Main { public static void main(String[] args) { int number = 29;
//checking whether the number is even or odd
if (number % 2 == 0)
System.out.println(number + " is Even");
else
System.out.println(number + " is odd");
}
} Output 29 is Odd