0% found this document useful (0 votes)
3 views

100+ CPP MCQ

The document provides a list of various projects related to Spring Boot, React JS, and MySQL, along with YouTube links for each project. It also includes a series of questions and answers related to C++ programming concepts, such as constructors, references, and operator overloading. Additionally, it offers subscription options for premium notes and a community for updates.

Uploaded by

d.ankiit25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

100+ CPP MCQ

The document provides a list of various projects related to Spring Boot, React JS, and MySQL, along with YouTube links for each project. It also includes a series of questions and answers related to C++ programming concepts, such as constructors, references, and operator overloading. Additionally, it offers subscription options for premium notes and a community for updates.

Uploaded by

d.ankiit25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Explore More

Subcription : Premium CDAC NOTES & MATERIAL @99

Contact to Join Click to Join


Premium Group Telegram Group

For More E-Notes


Join Our Community to stay Updated

TAP ON THE ICONS TO JOIN!


Project List

pg. 1 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 2 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 3 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

Spring Boot + React JS + MySQL Project List


Sr.No Project Name YouTube Link
1 Online E-Learning Hub Platform Project https://youtu.be/KMjyBaWmgzg?si=YckHuNzs7eC84-IW
2 PG Mate / Room sharing/Flat sharing https://youtu.be/4P9cIHg3wvk?si=4uEsi0962CG6Xodp
3 Tour and Travel System Project Version 1.0 https://youtu.be/-UHOBywHaP8?si=KHHfE_A0uv725f12
4 Marriage Hall Booking https://youtu.be/VXz0kZQi5to?si=llOS-QG3TpAFP5k7
5 Ecommerce Shopping project https://youtu.be/vJ_C6LkhrZ0?si=YhcBylSErvdn7paq
6 Bike Rental System Project https://youtu.be/FIzsAmIBCbk?si=7ujQTJqEgkQ8ju2H
7 Multi-Restaurant management system https://youtu.be/pvV-pM2Jf3s?si=PgvnT-yFc8ktrDxB
8 Hospital management system Project https://youtu.be/IynIouBZvY4?si=CXzQs3BsRkjKhZCw
9 Municipal Corporation system Project https://youtu.be/cVMx9NVyI4I?si=qX0oQt-GT-LR_5jF
10 Tour and Travel System Project version 2.0 https://youtu.be/_4u0mB9mHXE?si=gDiAhKBowi2gNUKZ

Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
1. Which of the followings is/are automatically added to every class, if we do not write our own?

A. Copy Constructor

B. Assignment Operator

C. A constructor without any parameter

D. All of the above

Answer» D. All of the above


discuss

2. When a copy constructor may be called?

A. When an object of the class is returned by value.

B. When an object of the class is passed (to a function) by value as an argument.

C. When an object is constructed based on another object of the same class

D. All of the above

Answer» D. All of the above


discuss

3. Constructors have _____ return type.

A. void

B. char

C. int

D. no

Answer» D. no
discuss

4. Implicit return type of a class constructor is:

A. not of class type itself

B. class type itself

C. a destructor of class type

D. a destructor not of class type

Answer» B. class type itself


discuss
5. Which of the following is true about constructors?
1) They cannot be virtual.
2) They cannot be private.
3) They are automatically called by new operator.

A. All 1, 2, and 3

B. Only 1 and 3

C. Only 1 and 2

D. Only 2 and 3

Answer» B. Only 1 and 3


discuss

6. Output of following program?


#include<iostream>
using namespace std;
class Point {
Point() { cout << "Constructor called"; }
}; int main()
{
Point t1;
return 0;
}

A. Compiler Error

B. Runtime Error

C. Constructor called

D. None of the above

Answer» A. Compiler Error


discuss

7. #include<iostream>
using namespace std;
class Point {
public:
Point() { cout << "Constructor called"; }
};
int main()
{
Point t1, *t2;
return 0;
}

A. Compiler Error

Answer» C. Constructor called


B. Constructor called Constructor called

C. Constructor called

D. None of the above

Answer» C. Constructor called


discuss

8. Which operator is having the highest precedence?

A. postfix

B. unary

C. shift

D. equality

Answer» D. equality
discuss

9. Which of the following is FALSE about references in C++?

A. References cannot be NULL

B. A reference must be initialized when declared

C. Once a reference is created, it cannot be later made to reference another object; it cannot be reset.

D. References cannot refer to constant value

Answer» D. References cannot refer to constant value


discuss

10. Which of the following functions must use reference?

A. Assignment operator function

B. Copy Constructor

C. Destructor

D. Parameterized constructor

Answer» B. Copy Constructor


discuss
11. Output of following C++ program?
#include<iostream>
using namespace std;
int main()
{
int x = 10;
int& ref = x;
ref = 20;
cout << "x = " << x << endl ;
x = 30;
cout << "ref = " << ref << endl;
return 0;
}

A. x = 20; ref = 30

B. x = 20; ref = 20

C. x = 10; ref = 30

D. x = 30; ref = 30

Answer» A. x = 20; ref = 30


discuss

12. What is the difference between struct and class in C++?

A. All members of a structure are public and structures don’t have constructors and destructors

Members of a class are private by default and members of struct are public by default. When deriving a struct from a
B. class/struct, default access-specifier for a base class/struct is public and when deriving a class, default access specifier is
private.

C. All members of a structure are public and structures don’t have virtual functions

D. All of the above

Answer» B. Members of a class are private by default and members of struct are public by default. When deriving a struct from a
class/struct, default access-specifier for a base class/struct is public and when deriving a class, default access specifier is private.
discuss

13. Predict the output of following C++ program.


#include<iostream>
using namespace std;
class Empty {};
int main() {
cout << sizeof(Empty);
return 0;
}

A. A non-zero value

Answer» A. A non-zero value


13. Predict the output of following C++ program.
#include<iostream>
using namespace std;
class Empty {};
int main() {
cout << sizeof(Empty);
return 0;
}

B. 0

C. Compiler Error

D. Runtime Error

Answer» A. A non-zero value


discuss

14. class Test {


int x;
};
int main() {
Test t;
cout << t.x;
return 0;
}

A. 0

B. Garbage Value

C. Compiler Error

D. None

Answer» C. Compiler Error


discuss

15. Which of the following is true?

A. All objects of a class share all data members of class

B. Objects of a class do not share non-static members. Every object has its own copy.

C. Objects of a class do not share codes of non-static methods, they have their own copy

D. None of the above

Answer» B. Objects of a class do not share non-static members. Every object has its own copy.
discuss
16. A member function can always access the data in __________, (in C++).

A. the class of which it is member

B. the object of which it is a member

C. the public part of its class

D. the private part of its class

Answer» A. the class of which it is member


discuss

17. Which of the following is not correct for virtual function in C++?

A. Must be declared in public section of class.

B. Virtual function can be static.

C. Virtual function should be accessed using pointers.

D. Virtual function is defined in base class.

Answer» B. Virtual function can be static.


discuss

18. Which of the following is not correct (in C++)?


1. Class templates and function templates are instantiated in the same way
2. Class templates differ from function templates in the way they are initiated
3. Class template is initiated by defining an object using the template argument
4. Class templates are generally used for storage classes

A. (1)

B. (2), (4)

C. (2), (3), (4)

D. (4)

Answer» C. (2), (3), (4)


discuss

19. Which of the following cannot be passed to a function in C++?

A. Constant

B. Structure

C. Array

D. Header file

Answer» D. Header file


discuss
20. Which of the following, in C++, is inherited in a derived class from base class?

A. Constructor

B. Destructor

C. Data members

D. Virtual methods

Answer» C. Data members


discuss

21. Which of the following is a correct statement?

A. Composition is a strong type of association between two classes with full ownership.

B. Composition is a strong type of association between two classes with partial ownership.

C. Composition is a weak type of association between two classes with partial ownership.

D. Composition is a weak type of association between two classes with strong ownership.

Answer» A. Composition is a strong type of association between two classes with full ownership.
discuss

22. Which of the following is not a correct statement?

A. Every class containing abstract method must be declared abstract.

B. Abstract class can directly be initiated with ‘new’ operator.

C. Abstract class can be initiated.

D. Abstract class does not contain any definition of implementation.

Answer» B. Abstract class can directly be initiated with ‘new’ operator.


discuss

23. When a method in a subclass has the same name and type signatures as a method in the superclass, then
the method in the subclass _____ the method in the superclass.

A. Overloads

Answer» D. Overrides
23. When a method in a subclass has the same name and type signatures as a method in the superclass, then
the method in the subclass _____ the method in the superclass.

B. Friendships

C. Inherits

D. Overrides

Answer» D. Overrides
discuss

24. It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.

A. 2

B. 3

C. 4

D. 5

Answer» A. 2
discuss

25. When one object reference variable is assigned to another object reference variable then

A. a copy of the object is created.

B. a copy of the reference is created.

C. a copy of the reference is not created.

D. it is illegal to assign one object reference variable to another object reference variable.

Answer» B. a copy of the reference is created.


discuss

26. Which of the following is not a member of class?

A. Static function

B. Friend function

Answer» B. Friend function


26. Which of the following is not a member of class?

C. Const function

D. Virtual function

Answer» B. Friend function


discuss

27. How can we restrict dynamic allocation of objects of a class using new?

A. By overloading new operator

B. By making an empty private new operator.

C. By making an empty private new and new[] operators

D. By overloading new operator and new[] operators

Answer» C. By making an empty private new and new[] operators


discuss

28. Which of the following operators cannot be overloaded?

A. . (Member Access or Dot operator)

B. ?: (Ternary or Conditional Operator)

C. :: (Scope Resolution Operator)

D. All of the above

Answer» D. All of the above


discuss

29. Which of the following operators are overloaded by default by the compiler in every user defined classes
even if user has not written? 1) Comparison Operator (==) 2) Assignment Operator (=)

A. Both 1 and 2

B. Only 1

C. Only 2

D. None of the two

Answer» C. Only 2
discuss

30. Which of the following operators should be preferred to overload as a global function rather than a
member method?

A. Postfix ++

B. Comparison Operator

C. Insertion Operator <<

Answer» C. Insertion Operator <<


30. Which of the following operators should be preferred to overload as a global function rather than a
member method?

D. Prefix++

Answer» C. Insertion Operator <<


discuss

31. How C++ compiler does differ between overloaded postfix and prefix operators?

A. C++ doesn’t allow both operators to be overloaded in a class

B. A postfix ++ has a dummy parameter

C. A prefix ++ has a dummy parameter

D. By making prefix ++ as a global function and postfix as a member function.

Answer» B. A postfix ++ has a dummy parameter


discuss

32. Which of the following operator functions cannot be global?

A. new

B. delete

C. Conversion Operator

D. All of the above

Answer» C. Conversion Operator


discuss

33. Which of the following is true about this pointer?

A. It is passed as a hidden argument to all function calls

B. It is passed as a hidden argument to all non-static function calls

C. It is passed as a hidden argument to all static functions

D. None of the above

Answer» B. It is passed as a hidden argument to all non-static function calls


discuss

34. What is the use of this pointer?

A. When local variable’s name is same as member’s name, we can access member using this pointer.

B. To return reference to the calling object

C. Can be used for chained function calls on an object

D. All of the above

Answer» D. All of the above


discuss
35. Which of the following in Object Oriented Programming is supported by Function overloading and default
arguments features of C++?

A. Inheritance

B. Polymorphism

C. Encapsulation

D. None of the above

Answer» B. Polymorphism
discuss

36. Output of the program?


#include<iostream>
using namespace std;
int fun(int x = 0, int y = 0, int z)
{ return (x + y + z); }
int main()
{
cout << fun(10);
return 0;
}

A. 10

B. 0

C. 20

D. Compiler Error

Answer» D. Compiler Error


discuss

37. Output of following program?


#include <iostream>
using namespace std;
int fun(int=0, int = 0);
int main()
{
cout << fun(5);
return 0;
}
int fun(int x, int y)
{
return (x+y);
}

A. Compiler Error

Answer» B. 5
B. 5

C. 0

D. 10

Answer» B. 5
discuss

38. Which of the following is true?

A. Static methods cannot be overloaded.

B. Static data members can only be accessed by static methods.

C. Non-static data members can be accessed by static methods.

D. Static methods can only access static members (data and methods)

Answer» D. Static methods can only access static members (data and methods)
discuss

39. If a function is friend of a class, which one of the following is wrong?

A. A function can only be declared a friend by a class itself.

B. Friend functions are not members of a class, they are associated with it.

C. Friend functions are members of a class.

D. It can have access to all members of the class, even private ones.

Answer» C. Friend functions are members of a class.


discuss

40. Which one of the following is correct, when a class grants friend status to another class?

A. The member functions of the class generating friendship can access the members of the friend class.

All member functions of the class granted friendship have unrestricted access to the members of the class granting the
B.
friendship.

C. Class friendship is reciprocal to each other.

Answer» B. All member functions of the class granted friendship have unrestricted access to the members of the class granting
the friendship.
40. Which one of the following is correct, when a class grants friend status to another class?

D. There is no such concept.

Answer» B. All member functions of the class granted friendship have unrestricted access to the members of the class granting
the friendship.
discuss

41. In C++, const qualifier can be applied to


1) Member functions of a class
2) Function arguments
3) To a class data member which is declared as static
4) Reference variables

A. Only 1, 2 and 3

B. Only 1, 2 and 4

C. All

D. Only 1, 3 and 4

Answer» C. All
discuss

42. How to create a dynamic array of pointers (to integers) of size 10 using new in C++? Hint: We can create a
non-dynamic array using int *arr[10]

A. int *arr = new int *[10];

B. int **arr = new int *[10];

C. int *arr = new int [10];

D. Not Possible

Answer» B. int **arr = new int *[10];


discuss

43. Which of the following is true about new when compared with malloc:
1) new is an operator, malloc is a function
2) new calls constructor, malloc doesn’t
3) new returns appropriate pointer, malloc returns void * and pointer needs to typecast to appropriate type.

A. 1 and 3

B. 2 and 3

C. 1 and 2

D. All 1, 2 and 3

Answer» D. All 1, 2 and 3


discuss
44. Predict the output?
#include <iostream>
using namespace std;
class Test
{
int x;
Test()
{
x = 5;
} };
int main()
{
Test *t = new Test;
cout << t->x;
}

A. Compiler Error

B. 5

C. Garbage Value

D. 0

Answer» A. Compiler Error


discuss

45. Is it fine to call delete twice for a pointer?


#include<iostream>
using namespace std;
int main()
{
int *ptr = new int;
delete ptr;
delete ptr;
return 0;
}

A. Yes

B. No

C. none

D. all

Answer» B. No
discuss
46. When the inheritance is private, the private methods in base class are __________ in the derived class (in
C++).

A. inaccessible

B. accessible

C. protected

D. public

Answer» A. inaccessible
discuss

47. What happens when delete is used for a NULL pointer?


int *ptr = NULL;
delete ptr;

A. Compiler Error

B. Run-time Crash

C. No Error

D. None

Answer» C. No Error
discuss

48. Which of the following is true about virtual functions in C++?

A. Virtual functions are functions that can be overridden in derived class with the same signature.

B. Virtual functions enable run-time polymorphism in a inheritance hierarchy.

If a function is ‘virtual’ in the base class, the most-derived class implementation of the function is called according to the
C. actual type of the object referred to, regardless of the declared type of the pointer or reference. In non-virtual functions, the
functions are called according to the type of reference or pointer.

D. All of the above

Answer» D. All of the above


discuss

49. Which of the following is true about pure virtual functions?


1) Their implementation is not provided in a class where they are declared.
2) If a class has a pure virtual function, then the class becomes abstract class and an
instance of this class cannot be created.

A. Both 1 and 2

B. Only 1

C. Only 2

D. Neither 1 nor 2

Answer» C. Only 2
discuss
50. What is the size of wchar_t in C++?

A. 2

B. 4

C. 2 or 4

D. Based on the number of bits in the system

Answer» D. Based on the number of bits in the system


discuss
51. Which of the following is true about templates?
1) Template is a feature of C++ that allows us to write one code for different data types.
2) We can write one function that can be used for all data types including user defined types. Like sort(),
max(), min(), ..etc.
3) We can write one class or struct that can be used for all data types including user defined types. Like
Linked List, Stack, Queue,..etc.
4) Template is an example of compile time polymorphism.

A. 1 and 2

B. 1, 2 and 3

C. 1, 2 and 4

D. 1, 2, 3 and 4

Answer» D. 1, 2, 3 and 4
discuss

52. Which of the following is incorrect in C++?


(1)When we write overloaded function we must code the function for each usage.
(2)When we write function template we code the function only once.
(3)It is difficult to debug macros
(4)Templates are more efficient than macros

A. (1) and (2)

B. (1), (2) and (3)

C. (3) and (4)

D. All are correct.

Answer» D. All are correct.


discuss

53. Pick the odd one out

A. array type

B. character type

C. Boolean type

D. integer type

Answer» A. array type


discuss

54. Which data type is used to represent the absence of parameters?

A. int

B. short

Answer» C. void
54. Which data type is used to represent the absence of parameters?

C. void

D. float

Answer» C. void
discuss

55. What does an escape code represent?

A. alert

B. backslash

C. tab

D. form feed

Answer» A. alert
discuss

56. Which type is best suited to represent the logical values?

A. integer

B. Boolean

C. character

D. all of the mentioned

Answer» B. Boolean
discuss

57. Identify the user-defined types from the following?

A. enumeration

B. classes

C. both enumeration and classes

D. int

Answer» C. both enumeration and classes


discuss

58. Which of the following statements are true? int f (float)

A. f is a function taking an argument of type int and returning a floating point number

B. f is a function taking an argument of type float and returning an integer

C. f is a function of type float

D. none of the mentioned

Answer» B. f is a function taking an argument of type float and returning an integer


discuss
59. The value 132.54 can be represented using which data type?

A. double

B. void

C. int

D. bool

Answer» A. double
discuss

60. When a language has the capability to produce new data type mean, it can be called as …...

A. overloaded

B. extensible

C. encapsulated

D. reprehensible

Answer» B. extensible
discuss

61. Choose the operator which cannot be overloaded.

A. /

B. ( )

C. ::

D. %

Answer» C. ::
discuss

62. Which operator is required to be overloaded as member function only?

A. _

B. _ _

C. ++ (postfix version)

D. =

Answer» D. =
discuss

63. Class function which is called automatically as soon as the object is created is called as __

A. Constructor

B. Destructor

Answer» A. Constructor
63. Class function which is called automatically as soon as the object is created is called as __

C. Friend function

D. Inline function.

Answer» A. Constructor
discuss

64. Which type of data file is analogous to an audio cassette tape?

A. Random access file

B. Sequential access file

C. Binary file

D. Source code file

Answer» B. Sequential access file


discuss

65. What is the built in library function to compare two strings?

A. string_cmp()

B. strcmp()

C. equals()

D. str_compare()

Answer» B. strcmp()
discuss

66. Which of the following are member dereferencing operators in CPP? 1. * 2. :: 3. ->* 4. ::* 5. ->

A. Only 1, 3, 4

B. Only 1 and 5

C. Only 3 and 4

D. Only 3,4,5

Answer» A. Only 1, 3, 4
discuss

67. Which of the followings is/are pointer-to-member declarator?

A. ->*

B. .*

C. ::*

D. both A and B

Answer» C. ::*
discuss
68. Assigning one or more function body to the same name is called ____________.

A. Function Overriding

B. Function Overloading

C. Both A and B

D. None of the above

Answer» B. Function Overloading


discuss

69. Default values for a function are specified when ____.

A. Function is defined

B. Function is declared

C. Both a and b

D. None of these

Answer» B. Function is declared


discuss

70. Which of the following best defines the syntax for template function?

A. Template

B. Template return_type Function_Name(Parameters)

C. Both a and b

D. None of these

Answer» C. Both a and b


discuss

71. Return type of uncaught_exception () is ________________.

A. int

B. bool

C. char *

D. double

Answer» B. bool
discuss

72. If inner catch handler is not able to handle the exception then__________.

A. Compiler will look for outer try handler

B. Program terminates abnormally

Answer» C. Compiler will check for appropriate catch handler of outer try block
72. If inner catch handler is not able to handle the exception then__________.

C. Compiler will check for appropriate catch handler of outer try block

D. None

Answer» C. Compiler will check for appropriate catch handler of outer try block
discuss

73. Attempting to throw an exception that is not supported by a function call results in calling _____________
library function.

A. indeterminate ()

B. unutilized()

C. unexpected()

D. unpredicted()

Answer» C. unexpected()
discuss

74. The code of statements which may cause abnormal termination of the program should be written
under_________ block.

A. Try

B. catch

C. Finally

D. None of these

Answer» A. Try
discuss

75. When a virtual function is redefined by the derived class, it is called___________.

A. Overloading

B. Overriding

C. Rewriting

D. All of these

Answer» B. Overriding
discuss

76. While overloading binary operators using member function, it requires ___ argument/s.

A. Zero

B. One

C. Two

Answer» B. One
76. While overloading binary operators using member function, it requires ___ argument/s.

D. Three

Answer» B. One
discuss

77. Where the default value of parameter have to be specified?

A. Function call

B. Function definition

C. Function prototype

D. Both B or C

Answer» C. Function prototype


discuss

78. For automatic objects, constructors and destructors are called each time the objects

A. enter and leave scope

B. inherit parent class

C. are constructed

D. are destroyed

Answer» A. enter and leave scope


discuss

79. Which operation is used as Logical 'AND'

A. Operator-&

B. Operator-

C. Operator-&&

D. Operator +

Answer» C. Operator-&&
discuss

80. When an ADT is implemented as a C++ class, which of the following should normally be true?

A. Member functions are private, member variables are public

B. Member functions are public, member variables are private

C. Member functions as well as member variables are private

D. Member functions as well as member variables are public

Answer» B. Member functions are public, member variables are private


discuss
81. Variable that are listed in function's calls are called

A. Actual parameter

B. Declared parameter

C. Passed parameter

D. None

Answer» B. Declared parameter


discuss

82. What kind of error can arise when there is a problem with memory?

A. Segmentation fault

B. Produce an error

C. Both Segmentation fault & Produce an error

D. None of the mentioned

Answer» A. Segmentation fault


discuss

83. Which operations don’t throw anything?

A. Operations which are reversible

B. Operations which are irreversible

C. Operations which are static

D. Operations which are dynamic

Answer» B. Operations which are irreversible


discuss

84. What operation can be performed by destructor?

A. Abort the program

B. Resource cleanup

C. Exit from the current block

D. None of the mentioned

Answer» B. Resource cleanup


discuss

85. Which interface in the container is required for storage management?

A. Memory management

B. Allocator interface

Answer» B. Allocator interface


85. Which interface in the container is required for storage management?

C. Memory interface

D. None of the mentioned

Answer» B. Allocator interface


discuss

86. How can the member functions in the container be accessed?

A. Iterator

B. Indirect

C. Both Iterator & Indirect

D. None of the mentioned

Answer» A. Iterator
discuss

87. In which type of storage location are the vector members stored?

A. Contiguous storage locations

B. Non-contiguous storage locations

C. Contiguous & Non-contiguous storage locations

D. None of the mentioned

Answer» A. Contiguous storage locations


discuss

88. What do container adapter provide to interface?

A. Restricted interface

B. More interface

C. No interface

D. None

Answer» A. Restricted interface


discuss

89. What does the sequence adaptor provide?

A. Insertion

B. Deletion

C. Interface to sequence container

D. None

Answer» C. Interface to sequence container


discuss
90. Which operators is part of RTTI?

A. dynamic_cast()

B. typeid

C. Both dynamic_cast() & typeid

D. None

Answer» C. Both dynamic_cast() & typeid


discuss

91. At which time does the static_cast can be applied?

A. Compile-time construct

B. Runtime construct

C. Both Compile-time & Runtime construct

D. None

Answer» A. Compile-time construct


discuss

92. Which function is used to position back from the end of file object?

A. seekg

B. seekp

C. both seekg & seekp

D. None

Answer» A. seekg
discuss

93. String class have a concat() function that is used to _____________________

A. Replace old string by new string

B. Add two strings

C. Append one string at end of another string

D. Remove a string from end of one string

Answer» C. Append one string at end of another string


discuss

94. Which among the following is/are type(s) of this pointer?

A. const

B. volatile

C. const or volatile

Answer» C. const or volatile


94. Which among the following is/are type(s) of this pointer?

D. int

Answer» C. const or volatile


discuss

95. Which is the pointer which denotes the object calling the member function?

A. Variable pointer

B. This pointer

C. Null pointer

D. Zero pointer

Answer» B. This pointer


discuss

96. Which property is shown most when upcasting is used?

A. Code reusability

B. Code efficiency

C. Complex code simple syntax

D. Encapsulation

Answer» C. Complex code simple syntax


discuss

97. If multiple inheritance is implemented, which upcasting will be correct?

A. Upcast to first base class listed in inheritance

B. Upcast to any base class

C. Upcast to send base class listed in inheritance

D. Upcast is not possible

Answer» B. Upcast to any base class


discuss

98. When are the pointer types known for upcasting the objects?

A. Compile time

B. Runtime

C. Source code build time

D. Doesn’t apply to pointer types

Answer» A. Compile time


discuss
99. Which among the following is a mandatory condition for downcasting?

A. It must not be done explicitly

B. It must be done implicitly

C. It must be done explicitly

D. It can’t be done explicitly

Answer» C. It must be done explicitly


discuss

100. Which container provides random access iterators?

A. vector

B. deque

C. sort

D. both vector & deque

Answer» D. both vector & deque


discuss
https://www.youtube.com/@codewitharrays

https://www.instagram.com/codewitharrays/

https://t.me/codewitharrays Group Link: https://t.me/ccee2025notes

+91 8007592194 +91 9284926333

[email protected]

https://codewitharrays.in/project

You might also like