Home

C++ Programming MCQ Solved Paper for RBI Grade B officer

Thursday 9th of March 2023

Sharing is caring

1. 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
2. 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
3. Static data member can be declared as const too.
A. True
B. False
C.
D.
Answer : A
4. 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
5. Which of the following are good reasons to use an object oriented language?
A. You can define your data types
B. Program statements are simpler than in procedural languages.
C. An OO program can be taught to correct its own errors.
D. It's easier to conceptualize an OO program.
Answer : A
6. A function that is called automatically when an object is created is known as
A. instantiation
B. function prototype
C. constructor
D. structure
Answer : C
7. Overloaded functions
A. Are a group of functions with the same name
B. All have the same number and types of arguments
C. Make life simpler for programmer
D. May fail unexpectedly due to stress
Answer : A
8. Member function cannot be called from within a constructor.
A. True
B. False
C.
D.
Answer : A
9. Pick out the most appropriate statement
A. All variables must be declared before they are used
B. Variables in C++ need not be declared and the type can be assigned dynamically
C. Variables in C++ can be declared at the end of the program (before the main function terminates)
D. Variables can not be used explicitly in C++
Answer : A
10. The template function declaration specifies
A. template class
B. a generic class
C. exception
D. identifier
Answer : B
11. Data objects can be initialized when allocating memory using 'new'.
A. True
B. False
C.
D.
Answer : A
12. Class members are _______________ by default
A. Private
B. protected
C. public
D. None of the above are correct
Answer : A
13. Which of the following is not a component of file system
A. Access method
B. Auxiliary storage management
C. Free integrity mechanism
D. None of the above
Answer : C
14. 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
15. By default, members cannot be inherited.
A. True
B. False
C.
D.
Answer : A
16. 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
17. 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
18. The declaration int **var1; shows that
A. var1 can not be accessed
B. var1 is a pointer to a pointer of type int
C. var1 is a protected data type of integer
D. this type declaration shows an error
Answer : B
19. 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
20. Dynamic memory can be allocated by the following declaration
A. new
B. volatile
C. static
D. ==
Answer : A
21. Reference to an object behaves like a constant pointer.
A. True
B. False
C.
D.
Answer : B
22. What is the value of Friday in the following - enum days { Monday, Tuesday, Wednesday = -1, Thursday, Friday, Saturday = 6, Sunday}
A. 1
B. 5
C. 0
D. -3
Answer : A
23. The scope resolution operator is -
A. ::
B. ;
C. <<
D. ->
Answer : A
24. Static data member occurs in only class scope.
A. True
B. False
C.
D.
Answer : B
25. Delete operator is used
A. To allocate storage
B. To deallocate storage
C. To delete variable name
D. None of the above are correct
Answer : B
26. this' is an implicit pointer.
A. True
B. False
C.
D.
Answer : A
27. Inline function specifier reduces the overheads associated with a normal function call.
A. True
B. False
C.
D.
Answer : A
28. One of the important features of an abstract class is
A. it need not have any object
B. it should be used only as a derived class
C. it need not have any members
D. none of the above
Answer : A
29. In C++, identifiers have to be declared at the beginning of the blocks.
A. True
B. False
C.
D.
Answer : A
30. An object is an allocated space in memory.
A. True
B. False
C.
D.
Answer : A
31. 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
32. In a class, only the member function can access data, which is not accessible to outside. This feature is called:
A. Data security
B. Data hiding
C. Data manipulation
D. Data definition
Answer : B
33. 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
34. Constructor returns void type value.
A. True
B. False
C.
D.
Answer : B
35. 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
36. Which of the following is true about const member functions?
A. const members can be invoked on both const as well as nonconst objects
B. const members can be invoked only on const objects and not on nonconst objects
C. nonconst members can be invoked on const objects as well as nonconst objects
D. none of the above
Answer : B
37. A destructor can have arguments like constructor.
A. True
B. False
C.
D.
Answer : B
38. A member function can always access the data
A. In the object of which it is a member
B. In the class of which it is a member
C. In the object of the class of which it is a member
D. In the public part of its class
Answer : B
39. The library function exit() causes an exit from
A. The loop in which it occurs
B. The block in which it occurs
C. The function in which it occurs
D. The program in which it occurs
Answer : D
40. The ?: can be used to replace
A. if-else statement
B. wild cards
C. no meaning in C++
D. returns the value
Answer : A
41. A constructor cannot be explicitly called.
A. True
B. False
C.
D.
Answer : A
42. The member of a structure can be accessed through a pointer by
A. ->
B. dot operator
C. ::
D. >>
Answer : A
43. 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
44. The members of a class by default are private.
A. True
B. False
C.
D.
Answer : A
45. A normal C++ operator that acts in a special way on newly defined data types is said to be
A. Glorified
B. Encapsulated
C. Classified
D. Overloaded
Answer : D
46. Operator overloading is
A. Making C++ operators work with objects
B. Making C++ operators more then they can handle
C. Giving new meaning to existing c++ operators
D. Making new C++ operators
Answer : C
47. 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
48. A variable defined within a block is visible
A. From the point of definition onwards in the program
B. From the point of definition onwards in the function
C. From the point of definition onwards in the block
D. Throughout the function
Answer : C
49. Pick out the most appropriate statement from the following
A. references are pointers
B. array of references can be created
C. you can not reference a reference variable
D. all of the above
Answer : C
50. Element double Array[7] is which element of the array?
A. sixth
B. seventh
C. eighth
D. impossible to tell
Answer : C

Sharing is caring