You are viewing a single comment's thread. Return to all comments →
This is my method.
Scanner sc = new Scanner(System.in); int myInt = sc.nextInt(); if(Isweird1(myInt)) { System.out.println("Weird"); } else { System.out.println("Not Weird"); } } private static boolean Isweird1(int myInt) { if (myInt%2==1 || (myInt >= 6 && myInt <= 20)) { return true; } return false; }
Seems like cookies are disabled on this browser, please enable them to open this website
Java If-Else
You are viewing a single comment's thread. Return to all comments →
This is my method.