Skip to content

Commit 8a9659c

Browse files
Even Odd
Even Odd Co-Authored-By: Manish Upadhyay <ermanishupadhyay@gmail.com>
1 parent 07ced93 commit 8a9659c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/JavaPrograms/EvenOdd.java

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package JavaPrograms;
2+
3+
import java.util.Scanner;
4+
5+
public class EvenOdd {
6+
7+
public static void main(String[] args) {
8+
Scanner reader = new Scanner(System.in);
9+
10+
System.out.println("Enter a number");
11+
12+
int num = reader.nextInt();
13+
14+
if(num % 2 == 0) {
15+
System.out.println(num + " is Even");
16+
}
17+
else {
18+
System.out.println(num + " is Odd");
19+
}
20+
21+
}
22+
23+
}

0 commit comments

Comments
 (0)