Professional Documents
Culture Documents
Test C++
Test C++
a) ios
b) fstream
c) ostream
d) All the Above
2) cin
a)
b)
c)
d)
b) ofstream
c) Both A and B
d) None of the Above
12) The operator that denotes address of a variable in C++ program is
a) *
b) %
c) $
d) &
13) The notation of ternary operator is
a) &
b) ?:
c) ~
d) %
14) Which of the following denote bitwise operators of C++?
a) ^
b) <<
c) ~
d) All the Above
15) The isolation of data from direct access by a C++ program is called as
a) Data Hiding
b) Data Encapsulation
c) Data Isolation
d) None of the Above
16) What is the notation used to place block of statements in a looping structure in C++?
a) % %
b) ( )
c) { }
d) None of the Above
17) Which of the looping structure in C++ check condition at the beginning of loop?
a) do-while
b) while
c) Both A and B
d) None of the Above
18) The friend function of a class in C++ can access
a) Private members of the class
b) protected members of the class
c) Both A and B
d) None of the Above
19) Which of the following allocates memory but does not initialize it?
a) operator delete
b) operator new
c) Both A and B
d) None of the Above
20) Reference to its own class can be accepted by
a) simple constructor
b) copy constructor
c) Both A and B
d) None of the Above
21) Index of an array starts from
a) One
b) Zero
c) Two
42) Which of the following is allowed for the value of subscript variable?
a) Positive Integer
b) Negative Integer
c) Both A and B
d) Float
43) Which of the following notation compares two variables X and Y?
a) X==Y
b) X=Y
c) X%Y
d) X equals Y
44) Which of the following denotes feature of OOPS?
a) Inheritance
b) Encapsulation
c) Polymorphism
d) All the Above
45) Which of the following denote C++ looping statement?
a) while
b) do-while
c) for
d) All the Above
46) A template can be instantiated by
a) Explicit Instantiation
b) Implicit instantiation
c) Both A and B
d) None of the Above
47) The notation of member access operator in structures is
a) &
b) .
c) $
d) *
48) A variable modified by multiple threads should be declared as
a) global
b) static
c) volatile
d) Non of the Above
49) The new operator in C++
a) Initialize the allocated memory
b) Allocates memory for the object
c) Both A and B
d) None of the Above
50) The data members and member functions that are only available to derived classes are
a) private
b) public
c) protected
d) None of the Above
51) Strict parameter type checking is followed with which of the following?
a) Inline
b) Macros
c) Both A and B
d) None of the Above
52) The function named as exforsys declared as int exforsys(float x, double y) has return
type as
a) double
b) int
c) float
d) Non of the Above
53) Virtual functions are defined in
a) Derived class
b) Base class
c) Both A and B
d) Non of the Above
54) The variables that are used to represent individual array element in an array is called as
a) Pointer Variable
b) Subscripted variable
c) Index Variable
d) Real Variable
55) Which of the following is used in C++ to create a copy of an object?
a) Assignment operator
b) Copy constructor
c) Both A and B
d) Non of the Above
56) What is the value of variable z when the following program segment ends? int z; for(z=0;
z<50; z++) {}
a) 51
b) 49
c) 50
d) 0
57) The header that should be included while using manipulators in C++ is
a) iomanip.h
b) manip.h
c) ifstream.h
d) Non of the Above
58) The value of EOF is
a) 1
b) 0
c) Infinity
d) -1
59) The vtable entry for a pure virtual function in C++ is
a) zero
b) NULL
c) one
d) No Entry in vtable
60) The variables that can be used only within the function in which it is declared is called as
a) Global Variables
b) Local Variables
c) Both A and B
d) None of the Above
61) The first fully Object-oriented language is
a) Java
b) C++
c) Simula
d) Non of the Above
62) What is the keyword used to allocate memory in C++?
a) assign
b) malloc
c) new
d) Non of the Above
63) RAiI stands for
a) Read Acquisition is Initialization
b) Resource Acquisition is Initializer
c) Resource Acquisition is Initialization
d) Non of the Above
64) Which of the following can be used to initialize a newly declared variable from an
existing variable?
a) Virtual Function
b) Namespaces
c) copy constructor
d) None of the Above
65) The class with name exforsys and having integer data x in its have constructor name as
a) exforsys
b) x
c) any name
d) Non of the Above
66) Which of the following denote insertion operator in C++?
a) &
b) >>
c) <<
d) !
67) Mutable keyword can be applied to
a) non-static data members of a class
b) non-const data members of a class
c) Both A and B
d) None of the Above
68) Which of the following denote library function in C++?
a) isalpha
b) isdigits
c) isspace
d) All the Above
69) The array exforsys[10] can be declared using pointers as
a) % exforsys[]
b) & exforsys[]
c) * exforsys[]
d) @ exforsys[]
70) If a function in C++ does not return a value then its return type is denoted as
a) float
b) int
c) void
d) None of the Above
Vocabulary
Allocate , ,
Bitwise - ,
Compare - , ,
Condition -
Denote ,
Derived - ,
Exist
Explicit -
Feature - ,
Implicit
Inheritance ,
Inline
Loop
Mandatory - ,
Memory leak
Mutable - , ,
Release - ,
Resolution
Resolve
Reusable -
Scope - , ,
Stream
Subscript - (, )
Subscripted variable
Provide , ,
Template
Volatile - , ,
Vtable -