Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

The mechanism of deriving a new class from another class

A. Polymorphism
B. Inheritance
C. Encapsulation
D. Data hiding
Answer» C. Encapsulation
2.

The same function name having different tasks

A. Function overloading
B. Constructor overloading
C. Polymorphism
D. Operator overloading
Answer» B. Constructor overloading
3.

A function calling itself

A. Inline function
B. Static function
C. Friend function
D. Recursion
Answer» E.
4.

The variable that contains the address of constant or variable

A. Function
B. Array
C. pointer
D. structure
Answer» D. structure
5.

The process of making a function to exhibit different behaviors in different instances is called ‐‐‐‐‐.

A. function overloading
B. operator overloading
C. inheritance
D. none of these
Answer» B. operator overloading
6.

The process of making an operator to exhibit different behaviors in different instances is called ‐‐‐‐‐.

A. function overloading
B. operator overloading
C. inheritance
D. none of these
Answer» C. inheritance
7.

‐‐‐‐‐ refer to the names of variables, functions, arrays, classes, etc.

A. Identifiers
B. Operators
C. Punctuators
D. Manipulators
Answer» B. Operators
8.

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ model is also known as linear sequential model.

A. prototype model
B. waterfall model
C. spiral model
D. none of these
Answer» C. spiral model
9.

A member function for unary operator overloading takes‐‐‐‐ ‐arguments.

A. Zero
B. One
C. Two
D. None
Answer» B. One
10.

Which allows you to create a derived class that inherits properties from more than one base class?

A. Multilevel inheritance
B. Multiple inheritance
C. Hybrid Inheritance
D. Hierarchical Inheritanc
Answer» C. Hybrid Inheritance
11.

Consider the following statements:int x = 22,y=15; x = (x>y) ? (x+y) : (x‐y); What will be the value of x after executing these statements?

A. 22
B. 37
C. 7
D. Error. Cannot be executed
Answer» C. 7
12.

In C++ default return type for all the functions is ‐‐‐‐‐‐‐‐‐.

A. int
B. void
C. float
D. none of these
Answer» B. void
13.

The keyword to convert constant into variable

A. Const_cast
B. reinterpret_cast
C. static_cast
D. implicit
Answer» B. reinterpret_cast
14.

In OOP which cocept provides the idea of reusability.

A. inheritance
B. encapsulation
C. data hiding
D. polymorphism
Answer» B. encapsulation
15.

Treating the address of the object of the derived class as the address of the base class means

A. Up casting
B. down casting
C. early binding
D. late binding
Answer» B. down casting
16.

By default, the members of a C++ class are:

A. Private
B. Public
C. Protected
D. None of these
Answer» B. Public
17.

A friend function for binary operator overloading takes‐‐‐‐ ‐arguments.

A. Zero
B. One
C. Two
D. None
Answer» D. None
18.

A __________ is a constructor that either has no parameters, or if it has parameters, all theparameters have default values.

A. default constructor
B. copy constructor
C. Both A and B
D. None of these
Answer» B. copy constructor
19.

Arguments of a functions are separated with

A. comma (,)
B. semicolon (;)
C. colon (:)
D. None of these
Answer» B. semicolon (;)
20.

The result of a Relational operation is always

A. either True or False
B. is less than or is more than
C. is equal or less or more
D. All of these
Answer» B. is less than or is more than
21.

The function contain in the ios class to specify number of decimal places

A. width()
B. precision()
C. fill()
D. setf()
Answer» C. fill()
22.

The class that derived from standard library ios contain input functions

A. Ios
B. iostream
C. istream
D. ostream
Answer» D. ostream
23.

Which of the following is a correct comment?

A. */ Comments */
B. ** Comment **
C. /* Comment */
D. { Comment }
Answer» B. ** Comment **
24.

The technique of Hiding internal details in an object is called‐‐‐‐‐

A. encapsulation
B. functions
C. Abstraction
D. inheritance
Answer» D. inheritance
25.

A friend function for unary operator overloading takes ‐‐‐‐ ‐arguments.

A. Zero
B. One
C. Two
D. None
Answer» C. Two
26.

A ‐‐‐‐‐‐‐‐ is a memory portion of memory to store a determined value.

A. Constant
B. Variable
C. Keyword
D. Separators
Answer» C. Keyword
27.

Strings are character arrays. The last index of it contains the null‐terminated character

A. \n
B. \t
C. \0
D. \1
Answer» D. \1
28.

Find the false statement from the following

A. An identifier in C++ is defined as an unlimited sequence of characters.
B. The first character must be an alphabet followed by digits or underscore or alphabets.
C. Identifiers are not case sensitive.
D. You can use both uppercase and lower case alphabets in the same identifier.
Answer» D. You can use both uppercase and lower case alphabets in the same identifier.
29.

The function that act as an interface to base & derived class

A. function overloading
B. virtual function
C. constructor
D. friend
Answer» C. constructor
30.

When following piece of code is executed, what happens?b = 3; a = b++;

A. a contains 3 and b contains 4
B. a contains 4 and b contains 4
C. a contains 4 and b contains 3
D. a contains 3 and b contains 3
Answer» B. a contains 4 and b contains 4
31.

int d=int (a) + int (b);This statement is an example of ‐‐‐‐‐‐‐

A. Implicit conversion
B. Explicit conversion
C. Internal conversion
D. External conversion
Answer» C. Internal conversion
32.

In case of arguments passed by values when calling a function such as z=addidion(x,y),

A. Any modifications to the variables x & y from inside the function will not have any effect outside the function.
B. The variables x and y will be updated when any modification is done in the function
C. The variables x and y are passed to the function addition
D. None of above are valid.
Answer» B. The variables x and y will be updated when any modification is done in the function
33.

An identifier may ‐‐‐‐‐‐‐‐

A. Strings, that varies at program execution.
B. Those numbers, that is frequently required in programs.
C. The name of a variable.
D. None of these
Answer» D. None of these
34.

The standard ASCII characters have numeric values from ‐‐‐ to ‐‐‐‐

A. 0 to 128
B. 0 to 127
C. 0 to 255
D. 0 to 256
Answer» C. 0 to 255
35.

The function used to display one line at a time

A. get()
B. put()
C. getline()
D. write()
Answer» E.
36.

The function used to receive one line at a time

A. get()
B. put()
C. getline()
D. write()
Answer» D. write()
37.

Which of the following is selection statement in C++?

A. Break
B. goto
C. exit
D. switch
Answer» E.
38.

The operator “>>” is called ‐‐‐‐‐

A. Extraction operator
B. Insertion operator
C. Put to operator
D. Printing operator
Answer» B. Insertion operator
39.

Identify the unary operator.

A. ? , :
B. ++
C. +
D. %
Answer» C. +
40.

The continue statement

A. resumes the program if it is hanged
B. resumes the program if it was break was applied
C. skips the rest of the loop in current iteration
D. all of above
Answer» D. all of above
41.

C++ is originally developed by

A. Nicolas Wirth
B. Dennis Ritchi
C. Bjarne Stroustrup
D. Ken Thompson
Answer» D. Ken Thompson
42.

The >> operator is known as‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

A. put to
B. get from
C. extraction
D. both b & c
Answer» E.
43.

A ‐‐‐‐‐‐‐‐ for an object is a request for execution of a procedure.

A. object
B. functions
C. dynamic binding
D. message
Answer» E.
44.

The class that is not used to create object

A. Abstract class
B. Virtual base class
C. Multiple inheritance
D. Nesting of classes
Answer» B. Virtual base class
45.

When a function is defined inside a class,it is treated as ‐‐‐‐‐‐‐

A. Inline function
B. Inside definition
C. Inline definition
D. Data function
Answer» B. Inside definition
46.

OOPs follows ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ approach during program design.

A. top down
B. bottom ‐up
C. both a & b
D. none of these
Answer» C. both a & b
47.

‐‐‐‐‐ are the reserved words of the programming language.

A. Tokens
B. Literals
C. Separators
D. Keywords
Answer» E.
48.

‐‐‐‐‐‐‐‐ contains function prototype for the standard input and output functions.

A. iomanip.h
B. iostream.h
C. stdlib.h
D. both a & b
Answer» C. stdlib.h
49.

What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero‐argument constructor?

A. Compile‐time error.
B. Preprocessing error.
C. Runtime error.
D. Runtime exception.
Answer» B. Preprocessing error.
50.

The class that derived from standard library ios contain output functions

A. Ios
B. iostream
C. istream
D. ostream
Answer» E.