From 070185931c54a8d5ee0160bb650d98db8d2454ee Mon Sep 17 00:00:00 2001 From: Gurirath <73177464+Gurirath@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:58:49 +0530 Subject: [PATCH 1/2] Create SolutionByGurirath.java --- .../SolutionByGurirath.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java diff --git a/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java b/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java new file mode 100644 index 000000000..e32daab72 --- /dev/null +++ b/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java @@ -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"); + } + } +} From bf68f43f0f4c6c2102bd13db327ab6303d9ee489 Mon Sep 17 00:00:00 2001 From: Gurirath <73177464+Gurirath@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:59:00 +0530 Subject: [PATCH 2/2] Update SolutionByGurirath.java --- .../SolutionByGurirath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java b/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java index e32daab72..a9b506177 100644 --- a/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java +++ b/Basic/Check Whether a Number is Even or Odd/SolutionByGurirath.java @@ -3,7 +3,7 @@ Write a number to check if it is even or odd. */ import java.util.*; -public class hacktoberfest2 +public class SolutionByGurirath { public static void main(String args[]) {