Ask Question
1 February, 16:30

Define the function isEven which returns True, if a given number is even and returns False, if the number is odd. Execute the statement isEven (43) and display the output.

+1
Answers (1)
  1. 1 February, 19:22
    0
    Program:

    #include / /header file

    char * isEven (int number) / /function

    {

    if (number%2==0)

    return "True";

    else

    return "False";

    }

    int main () / /mainfunction

    {

    printf ("%s", isEven (43)); / /calling and display output.

    return 0; / /return statement.

    }

    Output:

    The above program gives as 45 output.

    Explanation:

    The above program is in c-language, The above function is used to check the number is even or odd. If the number is even it returns true and if the number is odd, it returns false. The print statement called that function while passing the number on the argument and print the result of the function. The char * is used in return type because the function returns the string value.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Define the function isEven which returns True, if a given number is even and returns False, if the number is odd. Execute the statement ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers