We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java If-Else
- Discussions
Java If-Else
Java If-Else
Sort by
recency
|
2029 Discussions
|
Please Login in order to post a comment
if (N % 2 == 1) { 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 { System.out.println("Not Weird"); } }
if((N % 2 != 0)||(N % 2 ==0 && N>=6 && N<=20)){ System.out.println("weird"); }else if((N % 2 ==0 && N >=2 && N>=20)||(N<=5)){ System.out.println("Not weird"); }
if(N<=5 && N%2==0 ||(N>20 && N%2==0)){ System.out.println("Not Weird"); } else{ System.out.println("Weird"); }
if( N % 2 == 0) { if((N>=2 && N<= 5) || (N>20)) System.out.println("Not Weird");
n = int(input().strip())
if n % 2 == 1: print("Weird") elif n % 2 == 0 and 2 <= n <= 5: print("Not Weird") elif n % 2 == 0 and 6 <= n <= 20: print("Weird") elif n % 2 == 0 and n > 20: print("Not Weird")