Professional Documents
Culture Documents
Q 2 - Choose the respective delete operator usage for the expression ‘ptr=new int[100]’.
● A - delete ptr;
● B - delete ptr[];
● C - delete[] ptr;
● D - []delete ptr;
●
Q 6 - (i) ‘ios’ is the base class of ‘istream’
● (ii) All the files are classified into only 2 types. (1) Text Files (2) Binary Files.
● A - Only (i) is true
● B - Only (ii) is true
● C - Both (i) & (ii) are true
● D - Both (i) & (ii) are false
wchar_t
only a
both a and b
22.What is the output of the following?
#include <iostream>
int main()
char ch = ‘c’
return 0;
99 + 1
100
c + 1
100 + 1
23 .Which of the following cannot be friend?
Function
Class
Object
Operator function
24. What will be the output of this program?
#include <iostream>
int main()
int a = 8;
cout << “ANDing integer ‘a’ with ‘true’ :” << a && true;
return 0;
a
c
B
A
octal
binary
decimal
hexadecimal
.
28. What are the values of a and b?
int a = false
bool b = 99
1, true
1, false
0, true
0, false.
29. Which of the following literal integer constants are hexadecimal?
0x1a
024
01100100
hex01100100
30. The value 132.54 can represented using which data type?
double
void
int
boolean
31. What is the range of the unsigned char type?
-127 to 128
0 to 128
0 to 254
0 to 255
32. Identify the user-defined types from the following?
enumeration
classes
both a and b
int
33. What is the output for the following program?
#include <iostream>
int main ()
return 0;
}
0 (false)
1 (true)
Error
#include <iostream>
int main()
return 0;
J
I
35. Which of the following is an abstract data type?
int
double
string
class
36. Evaluate the following code
1
true
not compile
37. What is the output of this program?
#include <iostream>
int main()
int i = -3;
int k = i % 2;
cout << k;
return 0;
-1
implementation defined
38. Which of the following is not a type of constructor?
Copy constructor
Friend constructor
Default constructor
Parameterized constructor
39. cout is a/an __________ .?
operator
function
object
macro
40. Evaluate the following expression
(false && true) || false || true
0
false
Top-down
Right-left
Bottom-up
Left-right
42. Which concept uses the preincrement?
call by value
call by reference
call by function
queue
43. Which of the following is correct about function overloading?
Both A and B.
44. What is the output of this program?
#include <iostream>
class myclass
public:
int i;
myclass *operator->()
{return this;}
};
int main()
myclass ob;
ob->i = 10;
return 0;
11 11
10 10
runtime error
error
45. What is the output of this program?
#include <iostream>
return i;
int main()
cin.get();
return 0;
error
runtime error
46. In C++ ………………… operator is used for Dynamic memory allocation.
Scope resolution
Conditional
New
Membership access
derrived class
base class
class
Both a & b
None
50. What is the output of this program?
#include <stdio.h>
int main()
int x = 5, y = 5;
cout << ++x << --y << endl;
return 0;
55
64
46
45
.
51. Which inheritance type is used in the class given below?
Multilevel inheritance
Hybrid inheritance
Hierarchical Inheritance
Multiple inheritances
.
52. Which of the following statement is correct?
<<
+
Virtual polymorphism
Transient polymorphism
Ad-hoc polymorphism
Pseudo polymorphism
55. What is the output of this program?
#include <stdio.h>
int main()
int a = 21;
int c ;
c = a++;
cout << c;
return 0;
20
21
22
23
56. Pick out the correct statement .
Both a & b
local scope
regional scope
global scope
static scope
58. What is the output of the program
#include<iostream.h>
void main()
int n=1;
do
cout <<n<<“\t”;
n++;
} while (n<=100);
cout <<endl;
#include <stdio.h>
int main()
int x = 5, y = 5, z;
x = ++x; y = –y;
z = x++ + y–;
cout << z;
return 0;
11
10
12
60. Which rule will not affect the friend function?
private and protected members of a class cannot be accessed from outside
both a & b
constructor
copy-constructor
destructor
Friend functions
#include <iostream>
#include <string>
int main ()
string::iterator it;
str.erase (str.begin()+ 5, str.end()-7);
return 0;
jobs is
steve legend
steve
legend
64. Where does the exception are handled?
both a & b
both a & b
66. Which of the following operator can’t be overloaded?
::
-
[]
67. What is meant by template parameter?
try
throw
catch
whole program
both a & b
#include <iostream>
#include “math.h”
double MySqrt(double d)
if (d < 0.0)
return sqrt(d);
int main()
double d = 5;
2.236
#include <string>
int main ()
return 0;
61073741820
51073741820
class
typename
D ) function
75. Which operator is used to declare the destructor?
#
$
~
@
76. Which header file is used to declare the complex number?
complexnum
complex
complexnumber
77. Which method do we use to append more than one character at a time?
append
operator+=
concatenation
both a & b
78. How to declare the complex number?
(3,4)
complex(3,4)
(3,4i)
#include <iostream>
#include <complex>
int main()
{
i = i * 6 / 3;
cout << i;
return 0;
(4, 6)
(2, 3)
(6, 12)
Overloaded operator must have at least one operand of its class type.
The overloaded operators follow the syntax rules of the original operator.
83. Which of the following is a mechanism that allows several objects in an class
hierarchy to have different methods with the same name?
a) Aggregation
b) Polymorphism
c) Inheritance
d) All of the mentioned
93. Which of the following early OOD methods incorporates both a “micro development
process” and a “macro development process.” ?
a) Booch method
b) Rumbaugh method
c) Wirfs-Brock method
d) Coad and Yourdon method
94. Grady Booch, James Rumbaugh, and Ivar Jacobson combined the best features of their
individual object-oriented analysis into a new method for object oriented design known
as
a) HTML
b) XML
c) UML
d) SGML
95. A design description of an object is known as a class
a) instance
b) object
c) case
d) both instance and object
96. Which of the following is conceptually similar to objects?
a) PACKAGE
b) PROC
c) PRIVATE
d) None of the mentioned
97. A design description in OOD includes
a) Protocol Description
b) Implementation Description
c) Type Description
d) both Protocol and Implementation Description
98. Which of the following is not an operation as per OOD algorithms and data structures?
a) operations that manipulate data in some way
b) operations that perform a computation
c) operations that check for syntax errors
d) operations that monitor an object for the occurrence of a controlling event
99. Throughout the OOD process, a software engineer should look for every opportunity for
creating new design process.
a) True
b) False
100. Which of the following is the task of project indicators:
a) help in assessment of status of ongoing project
b) track potential risk
c) help in assessment of status of ongoing project & track potential risk
d) none of the mentioned
101. Which of the following does not affect the software quality and organizational
performance?
a) Market
b) Product
c) Technology
d) People
102. The intent of project metrics is:
a) minimization of development schedule
b) for strategic purposes
c) assessing project quality on ongoing basis
d) minimization of development schedule and assessing project quality on ongoing
basis
103. Which of the following is not a direct measure of SE process?
a) Efficiency
b) Cost
c) Effort Applied
d) All of the mentioned
104. Which of the following is an indirect measure of product?
a) Quality
b) Complexity
c) Reliability
d) All of the Mentioned
105. In size oriented metrics, metrics are developed based on the ___________________
a) number of Functions
b) number of user inputs
c) number of lines of code
d) amount of memory usage
106. Usability can be measured in terms of:
a) Intellectual skill to learn the system
b) Time required to become moderately efficient in system usage
c) Net increase in productivity
d) All of the mentioned
107. A graphical technique for finding if changes and variation in metrics data are
meaningful is known as
a) DRE (Defect Removal Efficiency)
b) Function points analysis
c) Control Chart
d) All of the mentioned
108. Defects removal efficiency (DRE)depends on:
a) E – errors found before software delivery
b) D – defects found after delivery to user
c) Both E and D
d) Varies with project