cpp quiz

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

1 1565
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

1 1040
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

1 6649
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

1 6068
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

2 5071
Ques:- Element double array [7] is which element of the array?
A. Sixth
B. Seventh
C. Eighth
D. Impossible

1 1905
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

3 3485
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

1 6083
Ques:- The public files in a class library usually contain
A. Variable definition
B. Class declarations
C. Constant definitions
D. Member function definitions

2 2959
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

2 1574
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

0 3369
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

1 7159
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

2 1543
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

1 4973
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

1 9159
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

0 5327
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

0 4873
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

1 9520
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

2 5431
Scroll to top