Skip to content

gauriladdha/java-program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

import java.util.Scanner;

public class EvenOdd { public static void main(String[] args) { Scanner sc = new Scanner(System.in);

    // Input from user
    System.out.print("Enter a number: ");
    int num = sc.nextInt();

    // Check even or odd
    if (num % 2 == 0) {
        System.out.println(num + " is an Even number.");
    } else {
        System.out.println(num + " is an Odd number.");
    }

    sc.close();
}

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published