Skip to content

Commit fd9d6ad

Browse files
authored
Merge pull request #111 from Opathak449/main
added EvenOdd
2 parents 74f02c7 + 2a79f74 commit fd9d6ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

EvenOdd.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.Scanner;
2+
3+
public class EvenOdd {
4+
5+
public static void main(String[] args) {
6+
7+
Scanner reader = new Scanner(System.in);
8+
9+
System.out.print("Enter a number: ");
10+
int num = reader.nextInt();
11+
12+
if(num % 2 == 0)
13+
System.out.println(num + " is even");
14+
else
15+
System.out.println(num + " is odd");
16+
}
17+
}

0 commit comments

Comments
 (0)