Placement papers on C++ - Set 4

Placement papers on C++ - Set 4


1. You can read input that consists of multiple lines of text using

the normal cout << combination
the cin.get( ) function with one argument
the cin.get( ) function with two arguments.
the cin.get( ) function with three arguments.
View Answer / Hide Answer

ANSWER: the cin.get( ) function with two arguments.




2. A property which is not true for classes is that they

are removed from memory when not in use
permit data to be hidden from other classes.
bring together all aspects of an entity in one place.
Can closely model objects in the real world.
View Answer / Hide Answer

ANSWER: bring together all aspects of an entity in one place.




3. Which of the following cannot be legitimately passed to a function

A constant
A variable.
A structure
A header file.
View Answer / Hide Answer

ANSWER: A header file.




4. The break statement causes an exit

from the innermost loop only
only from the innermost switch.
from all loops and switches
from the innermost loop or switch.
View Answer / Hide Answer

ANSWER: from the innermost loop or switch.




5. A variable defined within a block is visible

from the point of definition onward in the program.
from the point of definition onward in the function.
from the point of definition onward in the block
throughout the function.
View Answer / Hide Answer

ANSWER: from the point of definition onward in the block




6. If we create a file by ifstream , then the default mode of the file is _________

ios :: out
ios :: in
ios :: app
ios :: binary
View Answer / Hide Answer

ANSWER: ios :: in




7. Use of virtual functions implies

overloading
overriding
static binding
dynamic binding
View Answer / Hide Answer

ANSWER: dynamic binding




8. this pointer

implicitly points to an object
can be explicitly used in a class.
can be used to return an object.
All of the above.
View Answer / Hide Answer

ANSWER: All of the above.




9. Data members which are static

cannot be assigned a value
can only be used in static functions
cannot be defined in a Union
can be accessed outside the class
View Answer / Hide Answer

ANSWER: can only be used in static functions




10. In multiple inheritance

the base classes must have only default constructors
cannot have virtual functions
can include virtual classes
None of the above.
View Answer / Hide Answer

ANSWER: can include virtual classes


Post your comment