mirror of
https://github.com/RustyRaptor/isOddOrEven-collection.git
synced 2026-12-03 18:55:15 -07:00
16 lines
415 B
Java
16 lines
415 B
Java
import java.util.Scanner;
|
|
|
|
public class oddoreven{
|
|
public static void main(String args[]){
|
|
int x;
|
|
System.out.println("Enter an integer to check if it is odd or even ");
|
|
Scanner in = new Scanner(System.in);
|
|
x = in.nextInt();
|
|
|
|
if ( x % 2 == 0 )
|
|
System.out.println("You entered an even number.");
|
|
else
|
|
System.out.println("You entered an odd number.");
|
|
}
|
|
}
|