code.cpp 229 B

1234567891011
  1. /* Create a function that takes a number as an argument and returns
  2. * "even" for even numbers and "odd" for odd numbers.
  3. */
  4. std::string isEvenOrOdd(int num) {
  5. if (num%2==0) {
  6. return "even";
  7. }
  8. else {
  9. return "odd";
  10. }
  11. }