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 standard library inherited from istream & ostream

A. Ios
B. iostream
C. ifstream
D. ofstream
Answer» C. ifstream
2.

The duplication of inherited members due to the multiple paths can be avoided by making acommon base class is called

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

What will be the values of x, m and n after the execution of the following statements? int x, m, n;m = 10; n = 15; x = ++m + n++;

A. x=25, m=10, n=15
B. x=26, m=11, n=16
C. x=27, m=11, n=16
D. x=27, m=10, n=15
Answer» C. x=27, m=11, n=16
4.

‐‐‐‐‐‐‐‐‐‐‐ Statement used to branch unconditionally from one point to another in the program.

A. Jump
B. goto
C. break
D. exit(0)
Answer» C. break
5.

The instructions, which are used in programming, are called ‐‐‐‐‐‐‐‐

A. Data type
B. Keywords
C. Objects
D. Identifiers
Answer» C. Objects
6.

Which of the following statements are correct for a static member function?1. It can access only other static members of its class. 2. It can be called using the class name, instead of objects.

A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.
Answer» D. Both 1 and 2 are incorrect.
7.

The ‐‐‐‐‐‐‐ are used to check the relationship between two numeric operands or expressions.

A. Logical operators
B. Relational operators
C. Arithmetic operators
D. Bitwise operators
Answer» C. Arithmetic operators
8.

‐‐‐‐‐‐ refers to the use of the same thing for different purpose.

A. Function declaration
B. Overloading
C. Function calling
D. Prototyping
Answer» C. Function calling
9.

Which of the following function that must contain in all C++ Programs

A. start()
B. system()
C. main()
D. program()
Answer» D. program()
10.

Identify the data type of the value ‐2567113254L

A. Long integer
B. Integer
C. Short integer
D. Big integer
Answer» B. Integer
11.

The function contain in the ios class to set width

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

Write the range of value of the data type ‘int’

A. ‐32,768 to 32,767
B. 0 to 65535
C. 0 to 65536
D. 0 to 32768
Answer» B. 0 to 65535
13.

Which function is in the ostream class

A. get()
B. read()
C. write
D. cin
Answer» D. cin
14.

Which of the following statement is correct with respect to the use of friend keyword insidea class?

A. A private data member can be declared as a friend.
B. A class may be declared as a friend.
C. An object may be declared as a friend.
D. We can use friend keyword as a class name.
Answer» C. An object may be declared as a friend.
15.

‐‐‐‐‐‐‐‐‐‐ provides interface between the object’s data and program.

A. object
B. functions
C. class
D. polymorphism
Answer» C. class
16.

‐‐‐‐‐ function can only be called by another function that is a member of its class.

A. Member function
B. Private member function
C. Nested member function
D. Public member function
Answer» C. Nested member function
17.

The function contain in the ios class to fill characters in the blank space

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

The functions declared inside the class is known as ‐‐‐‐‐‐‐‐

A. Data members
B. Library functions
C. Member functions
D. User defined functions
Answer» D. User defined functions
19.

Which of the following is not a feature of OOPs.

A. polymorphism
B. inheritance
C. dynamic binding
D. none of these.
Answer» E.
20.

A variable is/are

A. String that varies during program execution
B. A portion of memory to store a determined value
C. Those numbers that are frequently required in programs
D. None of these
Answer» C. Those numbers that are frequently required in programs
21.

The mechanism of deriving one base class with more than one derived classes

A. Multilevel inheritance
B. Multiple inheritance
C. Hybrid Inheritance
D. Hierarchical Inheritance
Answer» E.
22.

‐‐‐‐‐ statement is used to print a blank line in CPP program

A. “\n”
B. endl
C. Both ‘a’ and ‘b’
D. None of these
Answer» D. None of these
23.

The wrapping up of data and functions into a single unit is called ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

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

The function contain in the class iomanip to fill characters in the un used space

A. setw()
B. set precision()
C. set fill()
D. setiosflags()
Answer» D. setiosflags()
25.

The function contain in the class iomanip to set width

A. setw()
B. set precision()
C. set fill()
D. setiosflags()
Answer» B. set precision()
26.

The function used to disply one character at a time

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

classes are ‐‐‐‐‐‐‐‐ datatype.

A. derived
B. user‐defined
C. built‐in
D. both a & c
Answer» C. built‐in
28.

Which of the following statement will be correct if the function has three arguments passedto it?

A. The trailing argument will be the default argument.
B. The first argument will be the default argument.
C. The middle argument will be the default argument.
D. All the argument will be the default argument.
Answer» B. The first argument will be the default argument.
29.

The

A. put to
B. get from
C. insertion
D. both a & c
Answer» E.
30.

The keyword to convert pointer into non pointer & non pointer into pointer

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

A function with the same name as the class, but preceded with a tilde character (~) is called__________ of that class.

A. constructor
B. destructor
C. function
D. object
Answer» C. function
32.

The ‐‐‐‐‐‐‐‐‐ principle helps the programmer to build secure programs.

A. operator overloading
B. encapsulation
C. data hiding
D. polymorphism
Answer» D. polymorphism
33.

Which one of the following is the correct operator to compare two values

A. :=
B. 0
C. Equal
D. 0
Answer» E.
34.

A ‐‐‐‐‐ is the name of the storage location

A. Identifier
B. Variable
C. Keyword
D. Token
Answer» C. Keyword
35.

What are the basic run time entities in an object oriented program?

A. objects
B. functions
C. datas
D. none of these
Answer» B. functions
36.

What is the final value of x when the code int x; for(x=0; x

A. 10
B. 9
C. 1
Answer» B. 9
37.

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ refers to the linking of procedure call to the code to be executed in response to thecall.

A. polymorphism
B. functions
C. dynamic binding
D. object
Answer» D. object
38.

The function that is a bridge between two classes

A. Friend function
B. Nesting of member function
C. Inline function
D. Static function
Answer» B. Nesting of member function
39.

A stream of byte that is the interface between IO and IO devices

A. Streams
B. class
C. object
D. file
Answer» B. class
40.

Which of the following is a UML constituents

A. things
B. relationships
C. diagrams
D. all of the above
Answer» E.
41.

Which of the following is an exit controlled loop?

A. While
B. For
C. Switch
D. do…. While
Answer» E.
42.

Find out the error in following block of code. If (x = 100) Cout

A. 100 should be enclosed in quotations
B. There is no semicolon at the end of first line
C. Equals to operator mistake
D. Variable x should not be inside quotation
Answer» D. Variable x should not be inside quotation
43.

Conversion of data type is called

A. self referencing
B. type casting
C. virtual function
D. abstract class
Answer» C. virtual function
44.

_________ used to make a copy of one class object from another class object of the sameclass type.

A. constructor
B. copy constructor
C. destructor
D. default constructor
Answer» C. destructor
45.

A derived class with only one base class

A. Multilevel inheritance
B. Multiple inheritance
C. Single inheritance
D. Hierarchical Inheritance
Answer» D. Hierarchical Inheritance
46.

The mechanism of giving special meaning to an operator

A. Operator overloading
B. Function overloading
C. Constructor overloading
D. Virtual function
Answer» B. Function overloading
47.

Which of the following means "The use of an object of one class in definition of anotherclass"?

A. Encapsulation
B. Inheritance
C. Composition
D. Abstraction
Answer» D. Abstraction
48.

Observe following function declaration and choose the best Ans:: int divide ( int a, int b = 2 )

A. Variable b is of integer type and will always have value 2
B. Variable a and b are of int type and the initial value of both variables is 2
C. Variable b is international scope and will have value 2
D. Variable b will have value 2 if not specified when calling function
Answer» E.
49.

The qualifier ‐‐‐‐‐‐ tells the compiler that the function should not modify the argument.

A. Const
B. Static
C. Constant
D. Inline
Answer» B. Static
50.

‐‐‐‐‐‐‐‐ are normally used to maintain values common to the entire class.

A. Dynamic variables
B. Static variables
C. Private variables
D. Public variables
Answer» C. Private variables