-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckNumber.java
More file actions
26 lines (23 loc) · 769 Bytes
/
CheckNumber.java
File metadata and controls
26 lines (23 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
public class CheckNumber {
/*****************************************************
Filename: CheckNumber
Created by: Melissa B.
Created on: 22 March 2017
Comment: Check to see if a number is ODD or EVEN
******************************************************/
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Enter a number: ");
int number = input.nextInt();
if(number % 2 == 0)
{
System.out.println("The number " + number + " is even.");
}
else
{
System.out.println("The number " + number + " is odd.");
}
}
}