

Computer Science - Programming in C++
Exam Duration: 45 Mins Total Questions : 30
Computer is a tool to solve a wide range of
- (a)
Programs
- (b)
Applications
- (c)
Software
- (d)
Problems
Which were viewed as a separate segment in OOP?
- (a)
Data & Control
- (b)
Data & Variables
- (c)
Data & operations
- (d)
All
Who developed C++?
- (a)
Dennis Ritchie
- (b)
Rick Mascitti
- (c)
Bjarne Stroustrup
- (d)
Don Bricklin
Which of the following also called variables?
- (a)
Identifiers
- (b)
Punctuators
- (c)
Constants
- (d)
Key words
Which of the following are data items whose value cannot be changed?
- (a)
Operators
- (b)
Keywords
- (c)
Variables
- (d)
Constants
Which of the following escape sequence is used to represent New line?
- (a)
\o
- (b)
\n
- (c)
\l
- (d)
\h
Which of the following operator gives the remainder of an integer division?
- (a)
*
- (b)
%
- (c)
-
- (d)
+
Which is a unary plus operator?
- (a)
+ =
- (b)
+
- (c)
+ +
- (d)
All of these
The logical operator || represents
- (a)
NOT
- (b)
OR
- (c)
AND
- (d)
EQUAL
Built in data type is
- (a)
float
- (b)
void
- (c)
Integral
- (d)
All the above
Which is not a derived data type?
- (a)
Function
- (b)
Reference
- (c)
Array
- (d)
Class
What are the operations that deal with pointer data type?
- (a)
&,&&
- (b)
&,*
- (c)
++,--
- (d)
&&,||
'size of ' is an
- (a)
operator
- (b)
identifier
- (c)
constant
- (d)
variable
To represent negative value the number 1 is store in the
- (a)
0th bit
- (b)
1st bit
- (c)
16th bit
- (d)
15th bit
int a,b,c ;
a=6;
b=7;
c= (a++)-(--b);
cout<
The output of the above code, when it is executed is
- (a)
0
- (b)
9
- (c)
11
- (d)
error
The escape sequence '\n' stands for
- (a)
backspace
- (b)
line feed
- (c)
tab
- (d)
bell sound
Which is the base address of an array?
- (a)
Array Identifier
- (b)
Address
- (c)
Index
- (d)
Variable
Matrices can be represented through __________ dimensional arrays.
- (a)
2
- (b)
4
- (c)
3
- (d)
1
The members that have been declared as _______ can be accessed only from within the class.
- (a)
Protected
- (b)
Private
- (c)
Public
- (d)
All of the above
When objects of a class are created, separate memory is allocated for
- (a)
Member variable only
- (b)
Member function only
- (c)
Neither function nor variables
- (d)
Both (a) and (b)
The variable shared by all the objects of a class, has the data type
- (a)
static
- (b)
auto
- (c)
extern
- (d)
private
Which of the following is used as prefix to destructor?
- (a)
~
- (b)
!
- (c)
@
- (d)
#
More traditionally default constructors are referred to------------------ generated constructors
- (a)
Compiler
- (b)
Interpreter
- (c)
Software
- (d)
Hardware
Which of the following has no return type and cannot be overloaded?
- (a)
Constructor
- (b)
Destructor
- (c)
Inline function
- (d)
Member Function
The constructor add(int s1, int s2) is called as--------------Constructors
- (a)
Class
- (b)
Parameterized
- (c)
Function
- (d)
Object
Char, float double parameters can be matched with int data type due to--------type conversions
- (a)
Auto
- (b)
Implict
- (c)
Explict
- (d)
Both(b) and (c)
The constructor ------------------- can be overloaded
- (a)
Class
- (b)
Function
- (c)
Constructor
- (d)
Destructor
The constructor add (add&a) is
- (a)
Default Constructor
- (b)
Non-Parameterized
- (c)
Compiler generator Constructor
- (d)
Copy constructor
Which of the following is true with respect to inheritance?
- (a)
Private members of base class are not inherited to the derived class with private accessibility
- (b)
Private members of base class are inherited to the derived class with private accessibility
- (c)
Public members of base class are inherited but not visible to the derived class
- (d)
None of the given
Reusability of code sharing, consistency of interface are all advantages of
- (a)
Polymorphism
- (b)
Overloading
- (c)
Inheritance
- (d)
Encapsulation