C++ Quiz
C++ Quiz
C++ Quiz
C++ QUIZ
ND
B. TECH. 2 SEMESTER MECHANICAL
TOTAL MARKS: 05
1 What does your class can hold?
a) data
b) functions
c) both a & b
d) none of the mentioned
Answer: C
Explanation: The classes in c++ are used to manipulate both data and functions.
3 Which other keywords are also used to declare the class other than class?
a) struct
b) union
c) object
d) both a & b
Answer: d
Explanation: Struct and union take the same definition of class but differs in the access
techniques.
9 If the user didn’t supply the user value means, then what value will it take?
a) default value
b) rise an error
c) both a & b
d) none of the mentioned
Answer: a
Explanation: If the user didn’t supply the value means, the compiler will take the given
value in the argument list.
10 Which value will it take when both user and default values are given?
a) user value
b) default value
c) custom value
d) none of the mentioned
Answer: a
Explanation: The default value will be used when the user value is not given, So in this
case, the user value will be taken.
A. ! B. ?
C. ~ D. $
Answer C
13 Which of the following is used to terminate the function declaration?
a) :
b) )
c) ;
d) none of the mentioned
Answer: c
Explanation: None.
15 What is the scope of the variable declared in the user definied function?
a) whole program
b) only inside the {} block
c) both a and b
d) none of the mentioned
Answer: b
Explanation: The variable is valid only in the function block as in other.