Algorithm 2 - Even or Odd

Beast from the east·2021년 10월 5일
0

Algorithm

목록 보기
2/27

Q.

Description:
Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers.

A)

const char * even_or_odd(int number)
{
  return ((number % 2 == 0) ? "Even" : "Odd");
}
profile
Hello, Rabbit

0개의 댓글