BASIC JAVA PROGRAMS
BASIC JAVA PROGRAMS ✅ 1. Check if a Number is Even or Odd Problem : Read a number and check whether it is even or odd. import java.util.Scanner; public class EvenOddCheck { public static void main (String[] args) { Scanner sc = new Scanner (System.in); System.out.print( "Enter a number: " ); int num = sc.nextInt(); if (num % 2 == 0 ) System.out.println(num + " is Even." ); else System.out.println(num + " is Odd." ); } } ✅ 2. Find the Largest of Three Numbers Problem : Take three numbers as input and find the largest among them. import java.util.Scanner; public class LargestOfThree { public static void main (String[] args) { Scanner sc = new Scanner (System.in); System.out.print( "Enter three numbers: " ); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if (a ...