Home

C++ Programming MCQ Solved Paper for SSC Stenographer

Thursday 9th of March 2023

Sharing is caring

1. The value of 'this' pointer can be changed.
A. True
B. False
C.
D.
Answer : B
2. The getch() library function
A. Returns a character when any key is pressed
B. Returns a character when ENTER is pressed
C. Display a character on the screen when a key is pressed
D. Does not display a character on the screen
Answer : A
3. A class that contains at least one pure virtual function is called as
A. pure class
B. abstract class
C. base class
D. derived class
Answer : B
4. Static data member can be declared as const too.
A. True
B. False
C.
D.
Answer : A
5. Reference to an object behaves like a constant pointer.
A. True
B. False
C.
D.
Answer : B
6. _____________ operator must have one class object
A. +
B. new
C. all
D. None of these
Answer : B
7. The signature of a function is
A. The return type
B. The number and type of arguments
C. The class of a function
D. None of the above
Answer : D
8. A destructor can have arguments like constructor.
A. True
B. False
C.
D.
Answer : B
9. If a friend function is declared inside a class it can access all data members of the class.
A. True
B. False
C.
D.
Answer : A
10. this' is an implicit pointer.
A. True
B. False
C.
D.
Answer : A
11. Member function cannot be called from within a constructor.
A. True
B. False
C.
D.
Answer : A
12. The string table in C++ holds the
A. string constants in your program
B. program statements in string form
C. variables whose type is of string
D. none of the above
Answer : A
13. A base class is inherited by
A. derived class
B. inline function
C. constructor
D. none of the above
Answer : A
14. Classes are useful because they
A. Are removed from memory when not in use
B. Permit data to be hidden from other classes
C. Bring together all aspects of an entity in one place
D. Can closely model objects in the real world
Answer : B
15. Inline function specifier reduces the overheads associated with a normal function call.
A. True
B. False
C.
D.
Answer : A
16. By using protected, one can create class members that are private to their class but
A. that can not be inherited and accessed by a derived class
B. that can still be inherited and accessed by a derived class
C. that can be public
D. none of the above
Answer : B
17. When one object initializes another object the following function is invoked
A. copy constructor
B. new
C. instantiation
D. none of the above
Answer : A
18. Objects get destroyed in the reverse order as they are created.
A. True
B. False
C.
D.
Answer : A
19. The new operator always returns a void pointer.
A. True
B. False
C.
D.
Answer : A
20. Which of the following can legitimately be passed to a function?
A. A constant
B. A variable
C. A structure
D. A header file
Answer : B
21. We cannot have the address of a constructor.
A. True
B. False
C.
D.
Answer : A
22. The template function declaration specifies
A. template class
B. a generic class
C. exception
D. identifier
Answer : B
23. "[]" Operator is a unary operator.
A. True
B. False
C.
D.
Answer : A
24. Private data members can be accessed
A. Only from the base class itself
B. Both from the base class and form its derived classes
C. From the class which is a friend of the base class
D. None of the above is correct
Answer : A
25. In C++, the keyword auto can be used for
A. Automatic assignment of data to object during instantiation
B. Automatic call of a function
C. To declare a local variable
D. It is not a keyword in C++
Answer : C
26. The break statement causes an exit
A. Only from the innermost loop
B. Only from the innermost switch
C. From all loops and switch
D. Only from the innermost loops or switch
Answer : A
27. The exception is processed using
A. unexpected()
B. perform()
C. catch()
D. try()
Answer : C
28. The binding that binds a function call at run time is called
A. early binding
B. run time binding
C. late binding
D. linking
Answer : C
29. When a language has the capacity to produce new data type, it is said to be
A. Reprehensible
B. Encapsulated
C. Overload
D. Extensible
Answer : D
30. A pure virtual function is a virtual function that has
A. no definition in its base class
B. a definition in its base class
C. a definition in at least one derived class
D. definition in base class and at least one derived class
Answer : A
31. If class A is friend of class B and if class B is friend of class C, which of the following is true?
A. Class C is friend of class A
B. Class A is friend of class C
C. Class A and Class C do not have any friend relationship
D. None of the above
Answer : B
32. By default, C++ uses the following method of passing arguments
A. Call-by-Reference
B. Call-by-Value
C. Call-by-Pointer
D. None of the above
Answer : B
33. One of the major disadvantage with late binding is
A. the source code should be made available at compile time
B. the program runs slower
C. dynamic variables can not be used in the program
D. static variables can not be used
Answer : B
34. The characteristic that data can be manipulated only through member functions that are part of the class is called
A. Encapsulation
B. Data dependency
C. Inheritance
D. Instantiation
Answer : A
35. We can make function inline by using the keyword 'inline'.
A. True
B. False
C.
D.
Answer : A
36. _______ argument(s) are passed in case of binary overloaded operators.
A. Two
B. One
C. No
D. None of the above
Answer : A
37. Class members are _______________ by default
A. Private
B. protected
C. public
D. None of the above are correct
Answer : A
38. Constructor returns void type value.
A. True
B. False
C.
D.
Answer : B
39. Static data member occurs in only class scope.
A. True
B. False
C.
D.
Answer : B
40. The member of a structure can be accessed through a pointer by
A. ->
B. dot operator
C. ::
D. >>
Answer : A
41. this' pointer has to be used while accessing data members in a member function.
A. True
B. False
C.
D.
Answer : A
42. In a for loop with a multi-statement loop body, semicolons should appear following
A. The for statement itself
B. The closing brace in a multi-statement loop body
C. Each statement within the loop body.
D. The test expression
Answer : C
43. When you overload an arithmetic assignment operator, the result
A. Goes in the object to the right of the operator
B. Goes in the object to the left of the operator
C. Goes in the object of which the operator is a member
D. Must be returned
Answer : B
44. In C++, identifiers have to be declared at the beginning of the blocks.
A. True
B. False
C.
D.
Answer : A
45. iostream is inheried from istream, ostream and ios class.
A. True
B. False
C.
D.
Answer : B
46. A copy constructor is used to copy an object member wise to another object of the same class.
A. True
B. False
C.
D.
Answer : A
47. The ?: can be used to replace
A. if-else statement
B. wild cards
C. no meaning in C++
D. returns the value
Answer : A
48. Class is similar to a variable.
A. True
B. False
C.
D.
Answer : B
49. Protected data members can be accessed
A. Only from the base class itself
B. Both form the base class and from its derived classes
C. From the class which is friend of the base class
D. None of the above are correct
Answer : B
50. The && and || operators
A. Compare two numeric values
B. Combine two numeric values
C. Compare two Boolean values
D. Combine two Boolean values
Answer : C

Sharing is caring