Skip to content

Commit 3897b57

Browse files
authored
Merge pull request #1941 from Gurirath/patch-12
Create SolutionByGurirath.java
2 parents eede8bb + bf68f43 commit 3897b57

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
/**
3+
Write a number to check if it is even or odd.
4+
*/
5+
import java.util.*;
6+
public class SolutionByGurirath
7+
{
8+
public static void main(String args[])
9+
{
10+
Scanner kb= new Scanner(System.in);
11+
int n;
12+
System.out.println("Enter a number to check if it is even or odd");
13+
n=kb.nextInt();
14+
if(n%2==0)
15+
{
16+
System.out.println("The number is even");
17+
}
18+
else
19+
{
20+
System.out.println("The number is odd");
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)