You are viewing a single comment's thread. Return to all comments →
the code is working
Scanner scanner=new Scanner(System.in); int n = scanner.nextInt(); String Print=""; if(n>=1 && n<=100){ if((n%2==1)||(n >=6 && n <=20)){ if(n%2==0){ Print="Weird"; } else if(n >20 ){ if(n%2==1){ Print="Weird"; }else Print="Not Weird" ; }else Print="Weird"; } else if((n >= 2 && n <= 5) || n >20){ Print="Not Weird" ; }else{ Print=""; } } System.out.println(Print);
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 →
the code is working