User defined functions in C are written using the keyword _____.

2023

User defined functions in C are written using the keyword _____.

  1. A.

    #define

  2. B.

    function keyword

  3. C.

    def keyword

  4. D.

    None of these

Attempted by 758 students.

Show answer & explanation

Correct answer: D

In C programming, user-defined functions do not require any special keyword. They are written using a return type, function name, parameters (optional), and a function body. The correct syntax is:

c

return_type function_name(parameters) {
    // function body
    return value;
}

#define is only for macros, function belongs to JavaScript, and def belongs to Python. Since none of the first three options are correct for C, the answer is None of these.

Explore the full course: Up Lt Grade Assistant Teacher 2025