bismiALLAH
This commit is contained in:
parent
2e448fb6ee
commit
7ab4c66ae6
22
OddEvens.java
Normal file
22
OddEvens.java
Normal file
@ -0,0 +1,22 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class OddEvens {
|
||||
public static void main(String[] args) {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
System.out.print("Please enter an Integer here: ");
|
||||
int N = sc.nextInt();
|
||||
sc.close();
|
||||
|
||||
if (N % 2 != 0) { // N is odd
|
||||
System.out.println("Weird");
|
||||
} else { // N is even
|
||||
if (N >= 2 && N <= 5) {
|
||||
System.out.println("Not Weird");
|
||||
} else if (N >= 6 && N <= 20) {
|
||||
System.out.println("Weird");
|
||||
} else if (N > 20) {
|
||||
System.out.println("Not Weird");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user