Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 SolutionByGurirath
{
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");
}
}
}