MCQ - Functions in C++ Programming

21. Which of the following function declaration is/are incorrect?

A. int Sum(int a, int b = 2, int c = 3);
B. int Sum(int a = 5, int b);
C. int Sum(int a = 0, int b, int c = 3);
D. Both B and C are incorrect.
E. All are correct.

View Answer

22.Which of the following functions are provided by compiler by default if we don’t write in a C++ class?

A. Copy constructor
B. Assignment
C. Constructor
D. All the above

View Answer

23.How many can max number of arguments present in function in the c99 compiler?

A. 99
B. 90
C. 102
D. 127

View Answer

24. Which of the followings is/are not false about friend function ?
i) It can be called / invoked with class object.
ii) It has objects as arguments.
iii) It can have built-in types as arguments.
iv) It must declared only in public part of a class.
v) It does not have this pointer as an argument.

A.Only ii,iv
B.Only i,ii,v
C.Only ii,iii,v
D.All of the above

View Answer

25.The maths function acos (x) stands for

A. Inverse Cosine of x
B. Inverse Sine of x
C. Inverse Tangent of x
D. Floor of x

View Answer

26.Which of the following statement is correct?

A. Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument.
B. Overloaded function must have default arguments.
C. Overloaded function must have default arguments starting from the left of argument list.
D. A function can be overloaded more than once.

View Answer

27.Constant function in C++ can be declared as

A. Void display()
B. Void display() const
C. Const void display()
D. Void const display()

View Answer

28.Where does the execution of the program starts?

A. User-defined function
B. Main function
C. Void function
D. None of the above

View Answer

29.A friend function does not have 'this' pointer associated with it.

A. True
B. False

View Answer

30.A programmer can create custom header files that must be end with

A. .h extension
B. .l extension
C. .ios extension
D. .a extension

View Answer

Also check :


* You must be logged in to add comment.