Can functions return enumeration constants in C?
a) Yes
b) No
c) Only if they are global
d) Only if they are static
Answer:
a) Yes
Explanation:
In C, functions can indeed return enumeration constants. An enumeration is a user-defined data type consisting of named integer constants, and since these constants are integers, they can be returned by functions like any other integer value.
Understanding how functions interact with enums allows you to create more organized and readable code when dealing with a set of related constants.