Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following is the correct form of a function declaration?

  • A.return-type function-name(argument type);
  • B.return-type function-name(argument type) {}
  • C.return-type (argument type)function-name
  • D.Both (a) and (b)

Answer: A

Correct answer: return-type function-name(argument type);

A declaration (prototype) states the return type, the name and the parameter types, and ends with a semicolon - no body. Adding a body makes it a definition, which is a different thing.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.