-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEven_OddDemo.java
More file actions
36 lines (35 loc) · 850 Bytes
/
Even_OddDemo.java
File metadata and controls
36 lines (35 loc) · 850 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
27
28
29
30
31
32
33
34
35
36
package my_frist_java;
/**
* @author ARIFUL ISLAM
*/
import java.util.Scanner;
public class Even_OddDemo {
/*public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num;
System.out.print("Enter any number : ");
num = input.nextInt();
if(num%2==0)
{
System.out.println("Even");
}
else
{
System.out.println("Odd");
}
}*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num;
System.out.print("Enter any number : ");
num =input.nextInt();
if(num%2==0)
{
System.out.println("Even");
}
else
{
System.out.println("Odd");
}
}
}