We can define evenness and oddness of nonnegative integers as follows: A number n is even if it is 0 or n – 1 is odd. A number n is odd if it is not 0 and n – 1 is even. Express these algorithms as two mutually recursive methods is Even() and is Odd(), each of which takes an int as an argument and returns a boolean.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here