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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B
Explanation: Both options are valid ways to define a function with a return type in C++.
Explanation by: Vikash Gupta
Both options are valid ways to define a function with a return type in C++.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
124
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
92%
Success Rate