User defined functions in C are written using the keyword _____.
2023
User defined functions in C are written using the keyword _____.
- A.
#define
- B.
functionkeyword - C.
defkeyword - 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.