Home

SSC JE - C++ Programming 1000+ MCQ [Solved] PDF Download

Thursday 9th of March 2023

Sharing is caring

1. "[]" Operator is a unary operator.
A. True
B. False
C.
D.
Answer : A
2. 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
3. The value of 'this' pointer can be changed.
A. True
B. False
C.
D.
Answer : B
4. Member function cannot be called from within a constructor.
A. True
B. False
C.
D.
Answer : A
5. 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
6. :: is known as
A. scope resolution operator
B. global operator
C. Both (a) & (b)
D. None of these
Answer : A
7. The new operator always returns a void pointer.
A. True
B. False
C.
D.
Answer : A
8. Scope resolution operator has the highest precedence.
A. True
B. False
C.
D.
Answer : A
9. 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
10. 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
11. 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
12. The member of a structure can be accessed through a pointer by
A. ->
B. dot operator
C. ::
D. >>
Answer : A
13. Friend function have access to the
A. private and protected members
B. public members only
C. private members only
D. None of the above are correct
Answer : B
14. The ?: can be used to replace
A. if-else statement
B. wild cards
C. no meaning in C++
D. returns the value
Answer : A
15. Inline function specifier reduces the overheads associated with a normal function call.
A. True
B. False
C.
D.
Answer : A
16. The members of a class by default are private.
A. True
B. False
C.
D.
Answer : A
17. The exception is processed using
A. unexpected()
B. perform()
C. catch()
D. try()
Answer : C
18. 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
19. 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
20. 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
21. In C++, the stream base class is
A. iostream
B. iofstream
C. ios
D. stdio
Answer : C
22. In case of nested class, enclosing class can directly access the private data member of nested class.
A. True
B. False
C.
D.
Answer : A
23. 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
24. Element double Array[7] is which element of the array?
A. sixth
B. seventh
C. eighth
D. impossible to tell
Answer : C
25. In C++, the exception handler is invoked with a-
A. try block
B. throw exception
C. catch function
D. abort()
Answer : B
26. 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
27. Static data member can be declared as const too.
A. True
B. False
C.
D.
Answer : A
28. cc ___________ option is used only to create object file
A. -a
B. -o
C. -c
D. none of these
Answer : B
29. 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
30. Class members are _______________ by default
A. Private
B. protected
C. public
D. None of the above are correct
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. 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
33. Which of the following relationship is known as inheritancerelationship?
A. ‘has-a’ relationship
B. ‘is-a’ relationship
C. association relationship
D. none of the above
Answer : A
34. 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
35. _______ argument(s) are passed in case of unary overloaded operators.
A. Two
B. One
C. No
D. None of the above
Answer : B
36. this' is an implicit pointer.
A. True
B. False
C.
D.
Answer : A
37. 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
38. Class is similar to a variable.
A. True
B. False
C.
D.
Answer : B
39. We can make function inline by using the keyword 'inline'.
A. True
B. False
C.
D.
Answer : A
40. 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
41. A destructor can have arguments like constructor.
A. True
B. False
C.
D.
Answer : B
42. iostream is inheried from istream, ostream and ios class.
A. True
B. False
C.
D.
Answer : B
43. Public 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
44. Organizing data with methods that operate on the data and creating a new data type is called encapsulation.
A. True
B. False
C.
D.
Answer : A
45. Dynamic memory can be allocated by the following declaration
A. new
B. volatile
C. static
D. ==
Answer : A
46. 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
47. 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
48. 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
49. A base class is inherited by
A. derived class
B. inline function
C. constructor
D. none of the above
Answer : A
50. In C++, an identifier must be initialized using constant expression.
A. True
B. False
C.
D.
Answer : B

Sharing is caring