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
|
1805 Discussions
|
Please Login in order to post a comment
Here is problem solution in Python, java, c++, c and javascript - https://programmingoneonone.com/hackerrank-day-3-intro-to-conditional-statements-solution.html
why my test case was faild
function addNumbers(n) { if(n % 2 !== 0) { console.log("weird")
} else { if (n >= 2 && n <= 5) { console.log("not weird") } else if(n >= 6 && n <= 20) { console.log("Weird") } else if(n > 20) { console.log("Not Weird") } } }
addNumbers(3)
My solution in C#
var isEven = N % 2 == 0;
`
Easy solution!