forked from khushal87/Data-structures-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.java
More file actions
35 lines (33 loc) · 657 Bytes
/
input.java
File metadata and controls
35 lines (33 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//By KHUSHAL AGARWAL
import java.util.Scanner;
public class input
{
int getInput()
{
Scanner obj=new Scanner(System.in);
System.out.println("Enter number - ");
int num=obj.nextInt();
return num;
}
void check(int n)
{
if(n%2==0)
{
System.out.println("Even number");
}
else
{
System.out.println("Odd number");
}
}
public static void main(String args[])
{
input obj=new input();
int check=obj.getInput();
obj.check(check);
}
}
//Output -
//Enter number -
//10
//Even number