Skip to content

Commit

Permalink
Create SolutionByGurirath.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurirath authored Oct 7, 2023
1 parent c7b27cd commit 0701859
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

/**
Write a number to check if it is even or odd.
*/
import java.util.*;
public class hacktoberfest2
{
public static void main(String args[])
{
Scanner kb= new Scanner(System.in);
int n;
System.out.println("Enter a number to check if it is even or odd");
n=kb.nextInt();
if(n%2==0)
{
System.out.println("The number is even");
}
else
{
System.out.println("The number is odd");
}
}
}

0 comments on commit 0701859

Please sign in to comment.