Q. Which of the following is the correct way to define a function that returns an integer and takes two integers as parameters?

  • (A) int func(int, int) { }
  • (B) void func(int, int) { }
  • (C) int func(int a, int b) { }
  • (D) int func(int a, b) { }
πŸ’¬ Discuss
βœ… Correct Answer: (C) int func(int a, int b) { }
Explanation: In C++, the function header includes the return type, followed by parameter types and names.
Explanation by: Vinay
In C++, the function header includes the return type, followed by parameter types and names.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
114
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
96%
Success Rate