Ask Question
26 July, 23:38

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. 27 July, 03:07
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers