• Courses
  • Tutorials
  • Practice
Switch to Dark Mode

C++ | Function Overloading and Default Arguments | Question 5

Last Updated : Jan 13, 2025
Discuss
Comments
Output of following program?
#include <iostream>
using namespace std;

int fun(int=0, int = 0);

int main()
{
  cout << fun(5);
  return 0;
}

int fun(int x, int y) { return (x+y); }
A
Compiler Error
B
5
C
0
D
10
Share your thoughts in the comments