V

Vikash Gupta • 33.56K Points
Instructor I

Q. Which of the following is the correct way to define a function with a return type in C++?

  • (A) int myFunction() { }
  • (B) void myFunction() { }
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(C)
  • Views: 72
  • Filed under category C++

Explanation by: Vikash Gupta
Both options are valid ways to define a function with a return type in C++.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics