wes d2a2ba9e15 first commit 4 anni fa
..
README.md d2a2ba9e15 first commit 4 anni fa
code.cpp d2a2ba9e15 first commit 4 anni fa
unitTest.cpp d2a2ba9e15 first commit 4 anni fa

README.md

Is the Number Even or Odd?

by Alex Golubov tags: math, validation, numbers, conditions

Summary

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"

Instructions

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" or "odd" in lowercase).