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.
Day 3: Intro to Conditional Statements
Day 3: Intro to Conditional Statements
Sort by
recency
|
1772 Discussions
|
Please Login in order to post a comment
Python :
C# Solution, a one-line lamba expression:
Console.WriteLine(N % 2 == 0 && (N < 6 || N > 20) ? "Not Weird" : "Weird");
javascript
let n;
if(n%2 != 0){ console.log("Weird");}
else if(n%2 == 0){ if(2<=n<=5){ console.log("Not Weird"); } else if(6<=n<=20){ console.log("Weird"); } else if(n > 20){ console.log("Not Weird"); }
}
JAVA
Solution