Question: 21 -
Where the default value of parameter have to be specified?
-
Function prototype
-
Function definition
-
Both B or C
-
Function call
Answer:
Function prototype
Solution not available.
Question: 22 -
If an argument from the parameter list of a function is defined constant then _______________
-
It cannot be modified inside the function
-
Segmentation fault
-
It can be modified inside the function
-
Error occurs
Answer:
It cannot be modified inside the function
Solution:
A function is not allowed a constant member of the parameter list.
A function is not allowed a constant member of the parameter list.
Question: 23 -
Which of the following function / type of function cannot be overloaded?
-
Both B and C
-
Virtual function
-
Static function
-
Member function
Answer:
Virtual function
Solution not available.
Question: 24 -
Which of the following feature is used in function overloading and function with default argument?
-
Abstraction
-
Polymorphism
-
Modularity
-
Encapsulation
Answer:
Polymorphism
Solution:
Both of the above types allows a function overloading which is the basic concept of Polymorphism.
Both of the above types allows a function overloading which is the basic concept of Polymorphism.
Question: 25 -
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.
-
A
-
B
-
D
-
C
Answer:
D