πŸ“Š C++
Q. Which of the following is the correct way to define a function with default arguments in C++?
  • (A) void myFunction(int x = 10, int y = 20) { }
  • (B) void myFunction(int x, int y = 20) { }
  • (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 default arguments in C++.

Explanation by: Admin
Both options are valid ways to define a function with default arguments in C++.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
106
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
95%
Success Rate