cpp quiz Interview Questions and Answers
Ques:- Keyword typed is used to declare
A. A synonym for an existing type
B. Absence of a type
C. Objects that can be modified outside of a program control
D. A member function that is defined in a subclass
Ques:- In C++ programming language, to write data that contains variables of type flat to an object of type of stream, which of the following should be used?
A. Put ( )
B. Seekg ( )
C. Write ( )
D. Insertion operator
Ques:- When a language has the capability to produce new data types, it is called
A. Extensible
B. Encapsulated
C. Reprehensible
D. None of these
Ques:- Classes are useful because they
A. Can closely model objects in the real world
B. Bring together all aspects of an entity in one place
C. Permit data to be hidden from other classes
D. Are removed from memory when not in use
Ques:- A function argument is a
A. Value sent to function by the calling program
B. Value returned by the function to the calling program
C. Variable in the function that receives a value from the calling program
D. Way that functions resist accepting the calling program’s values
Ques:- The break statement causes an exit
A. From the innermost loop or switch
B. Only from the innermost switch
C. Only from the innermost loop
D. From all loops and switches
Ques:- Element double array [7] is which element of the array?
A. Sixth
B. Seventh
C. Eighth
D. Impossible
Ques:- In C++, a structure brings together a group of
A. Items of the same data type
B. Integers with user-defined names
C. Related data items, variables
D. All of these
Ques:- In C++, which of the following can legitimately be passed to a function?
A. A constant
B. A variable
C. A structure
D. All of these
Ques:- The public files in a class library usually contain
A. Variable definition
B. Class declarations
C. Constant definitions
D. Member function definitions
Ques:- The member function can always access the data in
A. Any object of the class of which it is a member
B. The public part of its class
C. The class of which it is member
D. The object of which is a member
Ques:- In a stock, the data item placed on the stack first is
A. Given as index zero
B. Not given as index number
C. The first data item to be removed
D. The last data item to be removed
Ques:- Breaking a program into several files is desirable because
A. A program can be divided functionally
B. Each programmer can work on a separate file
C. Some files don’t need to be recompiled each time
D. Files can be marketed in object form
Ques:- Turbo C++ library function can be used
A. Draw lines and circles
B. Write text in a variety of fonts and sizes
C. Color any closed figure
D. All of these
Ques:- Which of the following are good reasons to use an object oriented language?
A. An object oriented program can be taught to correct its own errors
B. Program statements are simpler than in procedural language
C. We can define our own data types
D. None of these
Ques:- In a class specified, data or functions and designated private are accessible
A. Only to public members of class
B. Only if you know the password
C. To any function in the program
D. To member functions of that class
Ques:- A virtual base class is useful when
A. It makes sense to use a base class is ambiguous
B. Identification of a function in a base class is ambiguous
C. There are multiple paths from one derived class to another
D. Different functions in base and derived classes have the same name
Ques:- The keyword void is used to declare
A. Objects that can be modified outside of program control
B. A synonym for an existing type
C. A member function that is defined in a subclass
D. Absence of a type
Ques:- The dot operator connects which of the following two entities?
A. Class object and member of that class
B. Class and member of that class
C. Class object and a class
D. Class member and class object
Ques:- Virtual functions allow to
A. Use same function call to execute member functions of objects from different classes
B. Group objects of different classes so they can all be accessed by the same function code
C. Create functions that have no body
D. Create an array of type pointer to base calls that can hold pointers to derived classes