Home

C++ Programming MCQ Solved Paper for SSC CPO

Thursday 9th of March 2023

Sharing is caring

1. Scope resolution operator has the highest precedence.
A. True
B. False
C.
D.
Answer : A
2. 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
3. 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
4. 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
5. 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
6. 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
7. 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
8. A base class is inherited by
A. derived class
B. inline function
C. constructor
D. none of the above
Answer : A
9. 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
10. :: is known as
A. scope resolution operator
B. global operator
C. Both (a) & (b)
D. None of these
Answer : A
11. 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
12. 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
13. Sharing of common information are achieved by the concept of
A. Virtual copying
B. Inheritance
C. Encapsulation
D. None of these
Answer : B
14. iostream is inheried from istream, ostream and ios class.
A. True
B. False
C.
D.
Answer : B
15. this' pointer has to be used while accessing data members in a member function.
A. True
B. False
C.
D.
Answer : A
16. An object is an allocated space in memory.
A. True
B. False
C.
D.
Answer : A
17. cc ___________ option is used only to create object file
A. -a
B. -o
C. -c
D. none of these
Answer : B
18. Inline functions_____________ call overload.
A. Increase
B. Reduce
C. None of the above are correct
D.
Answer : B
19. Data objects can be initialized when allocating memory using 'new'.
A. True
B. False
C.
D.
Answer : A
20. this' is an implicit pointer.
A. True
B. False
C.
D.
Answer : A
21. new operator is used
A. To dynamically allocate storage
B. To statically allocate storage
C. To allocate storage for a new variable
D. None of the above are correct
Answer : C
22. 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
23. _____________ operator must have one class object
A. +
B. new
C. all
D. None of these
Answer : B
24. 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
25. You can read input that consists of multiple lines of text using
A. The normal cout<< combination
B. The cin.get() function with one argument
C. The cin.get() function with two argument
D. The cin.get() function with three argument
Answer : C
26. 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
27. A function that is called automatically when an object is destroyed is known as
A. instantiation
B. function prototype
C. constructor
D. destructor
Answer : D
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. What is the output of the following program segment - for(i = 1, j = 0; i < 10; i++) j += i; cout <<i<<"
";

A. 10
B. 20
C. 55
D. there is an error in the program
Answer : A
30. Private members of a structure can be accessed directly from the outside of the structure.
A. True
B. False
C.
D.
Answer : B
31. The template function declaration specifies
A. template class
B. a generic class
C. exception
D. identifier
Answer : B
32. The following syntax is valid. void inline gram_ panchayat :: show_gram_ panchayat_info().
A. True
B. False
C.
D.
Answer : B
33. 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
34. Element double Array[7] is which element of the array?
A. sixth
B. seventh
C. eighth
D. impossible to tell
Answer : C
35. Static data member can be declared as const too.
A. True
B. False
C.
D.
Answer : A
36. A destructor can have a return type.
A. True
B. False
C.
D.
Answer : B
37. Dynamic memory can be allocated by the following declaration
A. new
B. volatile
C. static
D. ==
Answer : A
38. 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
39. We can make function inline by using the keyword 'inline'.
A. True
B. False
C.
D.
Answer : A
40. Member function cannot be called from within a constructor.
A. True
B. False
C.
D.
Answer : A
41. The members of a class can be made private by
A. declaring them private
B. by default they are private
C. by declaring them in the beginning of the program immediately after main()
D. they are always public
Answer : A
42. 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
43. A destructor can have arguments like constructor.
A. True
B. False
C.
D.
Answer : B
44. 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
45. The member of a structure can be directly accessed by
A. ->
B. dot operator
C. ::
D. >>
Answer : B
46. 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
47. By default, members cannot be inherited.
A. True
B. False
C.
D.
Answer : A
48. _______ argument(s) are passed in case of binary overloaded operators.
A. Two
B. One
C. No
D. None of the above
Answer : A
49. 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
50. Objects get destroyed in the reverse order as they are created.
A. True
B. False
C.
D.
Answer : A

Sharing is caring