Each Question Carries 2 Marks
Each Question Carries 2 Marks
Q.1
(B) &temp
(D) float temp&
Ans: B
Q.2
(D) abc
Ans: C
Q.3
The process of building new classes from existing one is called ______.
(A) Polymorphism
(B) Structure
(C) Inheritance
(D) Cascading
Ans: C
Q.4
If a class C is derived from class B, which is derived from class A, all through public
inheritance, then a class C member function can access
Ans: D
Q.5
If the variable count exceeds 100, a single statement that prints Too many is
(A) if (count<100) cout << Too many;
(B) if (count>100) cout >> Too many;
(C) if (count>100) cout << Too many;
(D) None of these.
Code: AC11
PROGRAMMING
Ans: C
Q.6
Ans: D
Q.7
Ans: B
Q.8
Ans: A
Q.9
In C++, the range of signed integer type variable is
________
(A) 0 to
(B)
(C)
(D)
Ans: B
Q.10
If
then
equals________.
(D) 11001000
Ans: A
Q.11
If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________
(A) 3, 2
(B) 0, 2
(C) 3, 0
(D) 0, 4
Ans: C
Code: AC11
PROGRAMMING
Q.12
Ans: C
Q.13
Ans: B
Q.14
A function call mechanism that passes arguments to a function by passing a copy of
the values of the arguments is __________
(A) call by name
Ans: B
Q.15
(B) this
(C) malloc( )
(D) delete
Ans: A
Q.16
(B) ios :: in
Ans: B
Q.17
visible
Q.18
Ans: D
Q.19
Code: AC11
PROGRAMMING
(A) A constant.
(B) A variable.
(C) A structure.
Ans: D
Q.20
Ans: C
Q.21
You can read input that consists of multiple lines of text using
(A) the normal cout << combination.
(B) the cin.get( ) function with one argument.
(C) the cin.get( ) function with two arguments.
(D) the cin.get( ) function with three arguments.
Ans: C
Q.22
Ans: C
Q.23
(B) Inheritance.
(C) Polymorphism.
(D) Template.
Ans: B
Q.24
If you wanted to sort many large objects or structures, it would be most efficient to
Ans: C
Q.25
to ++i?
Code: AC11
PROGRAMMING
(C) a = i++;
(D) while (i++ = 20) cout <<i;
Ans: A
Q.26
Ans: D
Q.27
(B) ::
(C) ( )
(D) ~
Ans: B
Q.28
Ans: C
Q.29
Ans: A
Q.30
Ans: C
Q.31
(B) overriding.
Code: AC11
PROGRAMMING
Ans: D
Q.32
this pointer
(A) implicitly points to an object.
(B) can be explicitly used in a class.
(C) can be used to return an object.
(D) All of the above.
Ans: D
Q.33
statement
Within a switch
(A) Continue can be used but Break cannot be
used
(B) Continue cannot be used but Break can be used
(C) Both Continue and Break can be
used
(D) Neither Continue nor Break can be used
Ans:B
Q.34
Ans:B
Q.35
Ans:C
Q.36
Ans:D
Q.37
In multiple inheritance
(A) the base classes must have only default constructors
(B) cannot have virtual functions
(C) can include virtual classes
(D) None of the above.
Ans:C
Code: AC11
PROGRAMMING
Q.38
Ans:B
Q.39
for (; ;)
(A) means the test which is done using some expression is always true
(B) is not valid
(C) will loop forever
(D) should be written as for( )
Ans:C
Q.40
Ans:C
Q.41
an abstract class
Ans:D
Q.42
pointers
(B) &
(D)
Ans:D
Q.43
(D) last
Ans:A
Q.44
Code: AC11
PROGRAMMING
(B) Class for which two or more than two objects will be created
(C) Class for which copy constructor is defined
(D) Class whose objects will be created dynamically
Ans:D
Q.45
(B) protected
(C) private
Ans:C
Q.46
Given a class named Book, which of the following is not a valid constructor?
(A) Book ( ) { }
Ans:B
Q47
Which of the statements is true in a protected derivation of a derived class from a base
class?
(A) Private members of the base class become protected members of the derived
class
(B) Protected members of the base class become public members of the derived class
(C) Public members of the base class become protected members of the derived
class
(D) Protected derivation does not affect private and protected members of the
derived class.
Ans:C
Q48
Ans:D
Q.49
Ans:A
Q.50
Code: AC11
PROGRAMMING
Ans:C
Q.51
Ans:C
Q.52
have?
(B) 1
(D) any
Ans:D
Q.53
Ans:C
Q.54
(B) 37
(C) 7
Ans:B
Q.55
An exception is caused by
(A) a hardware problem
Ans:D
Q.56
A template class
(A) is designed to be stored in different containers
(B) works with different data types
(C) generates objects which must be identical
(D) generates classes with different numbers of member functions.
Ans:B
Code: AC11
PROGRAMMING
Q.57
Which of the following is the valid class declaration header for the derived class d
with base classes b1 and b2?
(A) class d : public b1, public b2
Ans:A
Q.58
Ans:D
Q.59
Ans:B
Q.60
Q.61
Ans:B
Q.62
If there is a pointer p to object of a base class and it contains the address of an object
of a derived class and both classes contain a virtual member function abc(), then the
statement
p->abc(); will cause the version of abc() in the __________class to be executed.
(A) Base Class
(B) Derived class
(C) Produces compile time error
(D) produces runtime
error
Ans:B
Q.63
Ans:D
Q.64
A static function
(A) should be called when an object is destroyed.
Code: AC11
PROGRAMMING
Ans:C
Q.65
because
We can output text to an object of class ostream using the insertion operator<<
(A) the ostream class is a stream
(B) the insertion operator works with all classes.
(C) we are actually outputting to cout.
(D) the insertion operator is overloaded in ostream.
Ans:D
Q.66
Ans:B
Q.67
To convert from a user defined class to a basic type, you would most likely use.
(A) A built-in conversion function.
(B) A one-argument constructor.
(C) A conversion function thats a member of the class.
(D) An overloaded = operator.
Ans:C
Q.68
Ans:D
Q.69
Name the header file to be included for the use of built in function isalnum()
(A) string.h
(B) process.h
(C) ctype.h
(D) dos.h
Ans:C
Q.70
Code: AC11
PROGRAMMING
f*=i;
cout<<f;
(A) 12
(B) 24
(C) 6
(D) 3
Ans:A
Q.71
(B) Inheritance
(C) Containership
(D) Encapsulation
Ans:A
Q.72
statements?
What will be the values of x, m and n after the execution of the following
int x, m, n;
m = 10;
n = 15;
x = ++m + n++;
(A) x=25, m=10, n=15
(C) x=27, m=11, n=16
n=15
Ans:B
Q.73
9.7?
(B) abs(x)
(D)
Ans:D
Q74
Ans:C
Q.75
Ans:D
Q.76
Ans:C
Q.77
The actual source code for implementing a template function is created when
(A) The declaration of function appears.
(B) The function is invoked.
(C) The definition of the function appears.
(D) None of the above.
Ans:B
Q.78
An exception is caused by
(A) a runtime error.
(B) a syntax error.
(C) a problem in the operating system.
(D)a hardware problem.
Ans:A
Q.79
Ans:B
Q.80
return 0;
}
(A) 1
(B) 0
(C) 10
(D) Error
Code: AC11
PROGRAMMING
Ans:A
Q.81
Ans:A
Q.82
program?
(B) 4.0
(D)
Ans:A
Q.83
A white space is :
(A) blank space
(C) tab
above
Ans:D
Q.84
(B) a class
Ans:B
Q.85
void main()
{
char *ptr=abcd
char ch;
ch = ++*ptr++;
Code: AC11
PROGRAMMING
cout<<ch;
}
(A) a
(B) b
(C) c
(D) d
Ans:B
Q.86
Ans:B
Q87
(A) no argument
Ans:A
Q88
Which of the following ways are legal to access a class data member using this pointer?
(A) this.x
(B) *this.x
(C) *(this.x)
(D) (*this).x
Ans:D
Q.89
Ans:B
Q.90
Ans:C
Q.91
(B) 25
(C) 9
(D) 12
Ans:C
Code: AC11
PROGRAMMING
Q.92
Ans:D
Q.93
To access the public function fbase() in the base class, a statement in a derived class
function fder() uses the statement.fbase();
(A) fbase();
(B) fder();
(C) base::fbase();
(D) der::fder();
Ans:A
Q.94
Ans:D
Q.95
Ans:D
Q 96
Ans:C
Q 97
Code: AC11
PROGRAMMING
Ans:D
Q.98
cout<<result;
}
(A) 1
(B) 1.0
(D) 2.5
Ans:C
Q.99
(B) expression
(D) all of the above.
Ans:A
Q.100
Ans:A