C भाषा में किसी फ़ंक्शन को परिभाषित करने के लिए किस कीवर्ड का उपयोग किया जाता है?
Which keyword is used to define a function in C Language?
In the C programming language, the keyword used to define a function is the function's return type (e.g., int, float, void, etc.). Unlike some other languages, C does not use a specific keyword like def or function to define a function.
In C programming, void is a keyword used to define a function that does not return a value. It can also be used for function parameters to indicate that the function does not take any arguments.
Key Uses of void:
-
Void Function:
A function that does not return a value is defined withvoidas the return type.In this case,
printMessagedoes not return any value, so its return type isvoid. -
Void Pointer:
Avoidpointer (void *) is a special pointer type that can point to any data type. It is used when the type of data is unknown or varies. -
Void Function Parameters:
If a function takes no arguments, you can specifyvoidin the parameter list.
In summary, void is used to specify that a function does not return a value or to declare pointers that can point to any data type.
Correct Answer: D) void