MCQ Practice Single Best Answer Topic: Function in C Language

Q What is the purpose of a function prototype in C language?

Question ID
#7185
Subchapter
Function in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A To define the implementation of a function.
  • B To declare the return type of a function.
  • C To declare the function name and its parameter types.
  • D To declare the function name and its return type.
Correct Answer: C

Explanation

Answer: c. To declare the function name and its parameter types.

Explanation: A function prototype is a declaration of the function name and its parameter types, but not its implementation or return type. It allows the compiler to know about the function before it is called, so that it can perform type checking and generate appropriate code.

Share This Question

Share this MCQ with your friends or study group.