We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7acd0bc commit a602d33Copy full SHA for a602d33
evenodd.java
@@ -0,0 +1,22 @@
1
+import java.util.Scanner;
2
+public class EvenOdd
3
+{
4
+public static void main (String args[])
5
6
+Scanner scan=new Scanner(System.in);
7
+System.out.print("Enter the number: ");
8
+//reading value from user
9
+int num=scan.nextInt();
10
+//method calling
11
+findEvenOdd(num);
12
+}
13
+//user defined method
14
+void findEvenOdd(int num)
15
16
+//method body
17
+if(num%2==0)
18
+System.out.println(num+" is even");
19
+else
20
+System.out.println(num+" is odd");
21
22
0 commit comments