July 8, 2021 in C and CPP
Discuss the salient features of C++ in comparison to C.
a) Discuss the salient features of C++ in comparison to C. Explain why object oriented
program is more robust than structured program.
July 8, 2021 in C and CPP
a) Discuss the salient features of C++ in comparison to C. Explain why object oriented
program is more robust than structured program.
July 8, 2021 in C and CPP
A. Data hiding B. >> C. Declaration
D. Polymorphism E. Definition F. Arguments
G. Catch H. Address I. Pointer
J. Private K. << L. Public
M. Ordinary N. Operator O. Constructor
4.1 A function prototype tells the compiler the return type, name and ________.
4.2 ________ is the symbol for insertion or put to operator.
4.3 Memory gets allocated during________ of a function.
4.4 Principal objective of OOP is ________.
4.5 C++ features which enables you to initialize an object on creation is called ________.
4.6 The keyword ________ is used for an overloaded operator function definition.
4.7 ________ type of declaration of a base class enables an object of a derived class to
access member functions.
4.8 The symbol & is called________.
4.9 Derived function uses a virtual function by________.
4.10 C++ language uses ________ keyword to handle exception.
July 8, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.
2.1 In C++, declaration can appear almost anywhere in the body of the function.
2.2 A C++ function can return multiple values to the calling function.
2.3 Defining a class also creates objects.
2.4 Members of a class specified as private are accessible only to the functions of the class.
2.5 Destructors should be defined by class name or constructor name.
2.6 If a unary operator ++ is overloaded, it makes no difference if it is used as pre or post increment with an object.
2.7 A member function in a base class can be accessed by an object of its derived class.
2.8 Pointers to an int and float are same.
2.9 All functions in an abstract base class must be declared pure virtual.
2.10 Exception means out of the ordinary or deviating from the normal course.
July 8, 2021 in C and CPP
1.10Redirection redirects
A) A stream from a file to the screen
B) A file from a device to a stream
C) The screen from a device to a stream
D) A device from the screen to a file
July 8, 2021 in C and CPP
1.9 A static function
A) should be called when an object is destroyed
B) can be called using class name and function name
C) can be called using object and function name
D) is used when a dummy object is created
July 8, 2021 in C and CPP
1.8 Consider the following code definition:
Class Person
{
};
Class Student: protected Person
{
};
What will happen when one tries to compile this class?
A) Will not compile, because class body of Person is not defined
B) Will not compile, because of Student is not defined
C) Will compile successfully
D) Will not compile, because class Person is not public inherited.
July 8, 2021 in C and CPP
1.7 Which of the following would be an invalid class declaration?
A) Class d: public b2, public b1
B) Class d: class b2, class b1
C) Class d: public b2, b1
D) Class d: b2, b1
July 8, 2021 in C and CPP
1.6 Which of the following are not keywords?
A) Null
B) protected
C) abstract
D) string
July 8, 2021 in C and CPP
1.5 A function in a class declared as private is accessible to-
A) Member function of its derived class of that class
B) Member function of all classes
C) Member function of that class
D) None of the above
1.4 What is achieved by the following declaration in class structure:
void operator + + ( ) {C+ + ;}
A) + + overloaded
B) pre increment
C) post increment
D) All of the above