wes d2a2ba9e15 first commit | 4 jaren geleden | |
---|---|---|
.. | ||
README.md | 4 jaren geleden | |
code.cpp | 4 jaren geleden | |
unitTest.cpp | 4 jaren geleden |
by Alex Golubov tags: math, validation, numbers, conditions
Create a function that takes a number as an argument and returns "even" for even numbers and "odd" for odd numbers. Examples isEvenOrOdd(3) ➞ "odd" isEvenOrOdd(146) ➞ "even" isEvenOrOdd(19) ➞ "odd" Notes Dont forget to return the result. Input will always be a valid integer. Expect negative integers (whole numbers). Tests are case sensitive (return "even"
Create a function that takes a number as an argument and returns "even"
for even numbers and "odd"
for odd numbers.
isEvenOrOdd(3) ➞ "odd"
isEvenOrOdd(146) ➞ "even"
isEvenOrOdd(19) ➞ "odd"
return
the result."even"
or "odd"
in lowercase).