In this challenge, we test your knowledge of using if-else conditional statements to automate decision-making processes. An if-else statement has the following logical flow:
CSZONE
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int N = scanner.nextInt();
if(N%2 !=0){
System.out.print("Weird");
}else if(N%2==0 && N >=2 && N<=5){
System.out.print("Not Weird");
}else if(N%2==0 && N >=6 && N<=20){
System.out.print("Weird");
}else if(N%2==0 && N>=20){
System.out.print("Not Weird");
}
}
}
Comments
Post a Comment