Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

C++ Programming

Cpp Programming Quiz 168 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. C++ enables to define functions that take constants as an argument.
[B]. We cannot change the argument of the function that that are declared as constant.[C]. Both A and B.
[D]. We cannot use the constant while defining the function.

Answer: Option C

Cpp Programming Quiz 168 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 169 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. Overloaded functions can have at most one default argument.
[B]. An overloaded function cannot have default argument.[C]. All arguments of an overloaded function can be default.
[D]. A function if overloaded more than once cannot have default argument.

Answer: Option C

Cpp Programming Quiz 169 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 170 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
void MyFunction(int a, int b = 40)
{
cout<< " a = "<< a << " b = " << b << endl; } int main() { MyFunction(20, 30); return 0; }

[A].a = 20 b = 40
[B].a = 20 b = 30
[C].a = 20 b = Garbage
[D].a = Garbage b = 40

Answer: Option B

Cpp Programming Quiz 170 – What will be the output of the following program? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 171 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A].Overloaded functions can accept same number of arguments.
[B].Overloaded functions always return value of same data type.[C].Overloaded functions can accept only same number and same type of arguments.
[D].Overloaded functions can accept only different number and different type of arguments.

Answer: Option A

Cpp Programming Quiz 171 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 173 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A].Constructors can have default parameters.
[B].Constructors cannot have default parameters.[C].Constructors cannot have more than one default parameter.
[D]Constructors can have at most five default parameters.

Answer: Option A

Cpp Programming Quiz 173 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 174 – Which of the following function / types of function cannot have default parameters?

Question: Which of the following function / types of function cannot have default parameters?
[A].Member function of class
[B].main()[C].Member function of structure
[D].Both B and C

Answer: Option B

Cpp Programming Quiz 174 – Which of the following function / types of function cannot have default parameters? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 176 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. Only one parameter of a function can be a default parameter.
[B]. Minimum one parameter of a function must be a default parameter.[C]. All the parameters of a function can be default parameters.
[D]. No parameter of a function can be default.

Answer: Option C

Cpp Programming Quiz 176 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 177 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. The order of the default argument will be right to left.
[B]. The order of the default argument will be left to right.[C]. The order of the default argument will be alternate.
[D]. The order of the default argument will be random.

Answer: Option A

Cpp Programming Quiz 177 – Which of the following statement is correct? Read More »

Cpp Programming, Functions