What does the ‘void’ keyword indicate in a C function declaration?
a) The function returns an integer
b) The function returns a floating-point number
c) The function does not return a value
d) The function returns a string
Answer:
c) The function does not return a value
Explanation:
In C, the void
keyword in a function declaration indicates that the function does not return a value. It is used when a function performs an operation but does not need to send any result back to the caller. For example, void displayMessage()
is a function that performs an action without returning any data.
Understanding the void
keyword is important for designing functions that execute operations without returning values.