adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    void Values(int n1, int n2 = 10)
    {
        using namespace std;
        cout << "1st value: " << n1;
        cout << "2nd value: " << n2;
    }
    int main()
    {
        Values(1);
        Values(3, 4);
        return 0;
    }

a.

1st value: 1 2nd value: 10 1st value: 3 2nd value: 4

b.

1st value: 1 2nd value: 10 1st value: 3 2nd value: 10

c.

compile time error

d.

none of the mentioned

Answer: (a).1st value: 1 2nd value: 10 1st value: 3 2nd value: 4

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?

Similar Questions

Discover Related MCQs

Q. What we can’t place followed by the non-default arguments?

Q. If we start our function call with default arguments means, what will be proceeding arguments?

Q. What is the default return type of a function ?

Q. Which header file is used to pass unknown number of arguments to function?

Q. How can you access the arguments that are manipulated in the function?

Q. What is the maximum number of arguments or parameters that can be

Q. Which header file should you include if you are to develop a function that can accept variable number of arguments?

Q. What will initialize the list of arguments in stdarg.h header file?

Q. To which does the function pointer point to?

Q. What we will not do with function pointers?

Q. What is the default calling convention for a compiler in c++?

Q. What are the mandatory part to present in function pointers?

Q. which of the following can be passed in function pointers?

Q. What is meaning of following declaration?
int(*ptr[5])();

Q. Which keyword is used to define the macros in c++?

Q. Which symbol is used to declare the preprocessor directives?

Q. How many types of macros are there in c++?

Q. What is the mandatory preprosessor directive for c++?

Q. What is the other name of the macro?

Q. Which of the following is used to implement the c++ interfaces?