You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner sc=new Scanner(System.in);
int N =sc.nextInt(); sc.close(); if(!iseven(N)){ System.out.println("Weird"); }else if(iseven(N) && N>=2 && N<=5){ System.out.println("Not Weird"); }else if(iseven(N) && N>=6 && N<=20){ System.out.println("Weird"); }else if(iseven(N) && N>=20){ System.out.println("Not Weird"); } } public static boolean iseven(int n){ return n%2==0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 3: Intro to Conditional Statements
You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner sc=new Scanner(System.in);