Skip to content

Commit 01769ae

Browse files
authored
even odd
1 parent 3f136cb commit 01769ae

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

evenodd.java

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

0 commit comments

Comments
 (0)