C++ Functions Quiz - Question 9

Last Updated :
Discuss
Comments

What is the output of the below function with default arguments?

C++
int add(int a, int b = 3) { 
  return a + b; 
}

int main()
{
    cout << add(2);
    return 0;
}

function with default arguments?


2

5

3

Error

Share your thoughts in the comments
Article Tags :