You are viewing a single comment's thread. Return to all comments →
Java added those as constants if(N%2!=0) { System.out.println(WEIRD); } else { 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); } }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Java If-Else
You are viewing a single comment's thread. Return to all comments →
Java added those as constants if(N%2!=0) { System.out.println(WEIRD); } else { 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); } }