-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCC4p1q1.java
More file actions
31 lines (24 loc) · 852 Bytes
/
CC4p1q1.java
File metadata and controls
31 lines (24 loc) · 852 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
// - Create a class called "Find" with main function
// - Create a function called evenoradd with int prameter called int num
// - Inside main function get integer input from user
// - Pass that function to the evenoradd funciton and let the fucntion decide whather the number is even or odd
import java.util.Scanner;
public class CC4p1q1 {
void evenoradd(int num)
{
if(num % 2 == 0)
{
System.out.println("Even Number");
}
else{
System.out.println("Odd Number");
}
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the Number ");
int number = scan.nextInt();
CC4p1q1 obj1 = new CC4p1q1();
obj1.evenoradd(number);
}
}