You are on page 1of 9

1) Procedure oriented Programs are called as

A Structured programming
B Object oriented programming
C Functional programming
D None of the above

2)A _____________ is a class whose instances themselves are classes.
A subclass
B abstarct class
C metaclass
D object class

3)_______________ enables you to hide, inside the object, both the data fields and the methods
that act on that data.
A Encapsulation
B Polymorphism
C Inheritance
D Overloading

4)For a 16 bit word length Integer data type values lie between ________________
A –32768 to 32767.
B 0 to 32767
C -128 to 128
D 0 to 128

5)The __________ operator is known as insertion operator
A >>
B >
C <<
D <

6)Which of the following is NOT a Relational Operator
A ==
B >
C %
D !=

7)A __________ is an abstract idea that can be represented with data structures and functions.
A class
B object
C loop
D data type

by making them as _________________. from existing classes called base class A Inheritance B encapsulation C Polymorphism D overloading 11)A ___________ class can share selected properties of its base classes. A Constant B variable C Pointer D object 13)To perform identical operations for each type of data compactly and conveniently we have to use A Exception B constant parameter C function templates D None of the above 14)_____________ function writes a string of text to a window. A abstarct B derived C subclass D both b & c 12)A _______________ is the address of a memory location and provides an indirect way of accessing data in memory. 9)A class can allow non-member functions and other classes to access its own private data. A private B protected C Friend D public 10)____________________ is the process of creating new classes. .8)Automatic Initialization of object is carried out using a special member function called ____________________ A friend B casting C reference parameter D constructor. called derived classes.

A osstream B ofstream C stream D ifstream 17)Which function return the current position of the get or put pointer in bytes. A + B ++ C :: D == 20)In c++ ___________ Operator is used for Dynamic memory allocation A Scope resolution B Conditional C New D Membership access . A tellg () B tellp () C tell () D Both A and B 18)________________ is a technique that allows the user considerable flexibility in the way the programs are used A Redirection B manipulation C Detecting D None of the above 19)Operator such as ______________ cannot be overloaded.A cputs ( ) B put () C gets () D tputs () 15)In graphics mode the basic element is a __________ A character B text C table D pixel 16)The ________________ objects have values that can be tested for various error conditions.

Int 6. Char A 1-2-3-4-5-6 B 1-3-2-4-5-6 C 1-2-3-5-4-6 D 1-2-4-3-5-6 23)State True or False 1. A static member function cannot have access to the 'this' pointer of the class. . ifstream infile ("out. increased programming productivity 2. Float 4. A 1-T. 2. cout << buffer. decreased maintenance costs.2-F B 1-F.2-T D 1-F. easy to understand A 1& 3 B 1& 2 C 3& 4 D 2& 3 22)Find the Hierarchy Of Data Types 1.2-F B 1-T. } } A check a ACII charcter in a File.txt"). C reads an Ascii String File.2-T 25)Which functions return the maximum pixels in each row (number of columns) and each column (number of rows) of the screen A getmar() and getmac() B maxx() and maxy() C getmaxx() and getmaxy() D getmayy() and getmaxy() 26)what does this program do # include <fstream.2-T C 1-T.getline(buffer. D check a String File.21)The advantages of OOP are . you cannot create new objects that perform the same functions as the base object A 1-T. less time to execute 4. whereas a non-static member functions can be declared as virtual 2. Long 5.2-F D 1-T. 1.2-T C 1-F.2-F 24)State True or False 1. B reads an String File.max). Long double 2. By using polymorphism. 3. Double 3.h> void main() { const int max = 80. A static member function cannot be declared virtual. The this pointer is used as a pointer to the class object instance by the member function. while (infile) { infile. char buffer[80].

16. C int a[5]={19. 16. 2. do { cout <<n<<"\t". 2-F B 1-F. Public data members can be accessed directly in the main function without an object. } . Constructors can be overloaded. A 1-F. 32) Define the relationshiphttp://i2.is-a.a-kind-of 3. else cout<<”You are not teen-aged”. cout <<endl<<"The numbers are . 2-T D 1-T. } A 15 B You are a teen-aged person C 20 D You are not teen-aged 28)The first index number in an array starts with _________ and the last index number of an array of size n will be ______ A 0 & n-1 B 1 & n-1 C 0&n D 1&n 29)State True or False 1. 2-T C 1-T. 2.3. if (age > 12 && age < 20) cout<<”You are a teen-aged person”. cout<<endl. c.com/www. 50}. B int a[]={19.h> void main() { int n=1. part-of 3. 2. 2-F To overload an operator _____________keyword must be used along with the operator to be overloaded.jpg A 1-is-a.27)Find the output of the following program #include <iostream. n++. b. D int a[5].a-kind-of B 1-is-a. 30)To overload an operator _____________keyword must be used along with the operator to be overloaded. } while (n<=100).com/wp- content/uploads/2013/07/Pic. Part-of C 1 a-kind-of-2. 50}."<<endl.jbigdeal. A Over B Overload C void D Operator 31)Which one of the following declaration is invalid? A int a[]. 1.wp. 21.h> Void main () { int age=15. Part-of D None of the above 33)What is the output of the program # include <iostream.

y->Create().setmember (0. }Output: A New Object Created New Object Created One Object Deleted B New Object Created New Object Created C New Object Created One Object Deleted D New Object Created New Object Created One Object Deleted One Object Deleted 35)What is the output of the program class Window // Base class for C++ virtual function example { public: virtual void Create() { cout <<"Base class Window"<<endl. } int getcount() { return count. int N> class array { T memblock [N]. } A Base class Window B Base class Window Derived class Command Button C Derived class Command Button D ERROR 36)What is the output of the program #include <iostream. T value). int N> T array<T. cout << myfloats.N>::setmember (int x. } }. } ~counter() { cout<<"One Object Deleted\n" . int N> array<T. }. x = new Window(). Class DC: public BC1. } }.h> void main() { ofstream tstfile ("out. *y. } }. y = new CommandButton(). array <float. while (text[i]) tstfile.setmember (3. myints. template <class T. } template <class T. void main() { counter c1. myfloats.getmember(3) << '\n'. Public Bc2 { }. public: void setmember (int x. cout << myints. }. T value) { memblock[x]=value. }. } int main () { array <int.c2.3.A print natural numbers 0 to 99 B print natural numbers 1 to 99 C print natural numbers 0 to 100 D print natural numbers 1 to 100 34)What is the output of the program # include <iostream. x->Create().dat").getmember(0) << '\n'. } A 100 3. int i=0. . public : counter() { count = 0. put(text[i++]). return 0.100). char text[ ] = "This is a text line".h> template <class T.N>::getmember (int x) { return memblock[x].5> myfloats. } A to create a file B to print a text on monitor C to read a file D None of the above 38)In the below Declaration how many copies of x does DC inherits ? Class BC { Private: int x. cout<<"New Object Created\n". class CommandButton : public Window { public: void Create() { cout<<"Derived class Command Button "<<endl.h> class counter { private : int count. }.5> myints. Class BC1: virtual public BC { Private : Float y.1416).1416 B syntax error C 100 D No output 37)What is the use of the this program # include <fstream. } void inc_count () { count++. T getmember (int x). void main() { Window *x. Class BC2: virtual public BC { Private: float z.

. ? A For an operation that replaces an inherited method for the same operatio B For a data that replaces an inherited method for the same operation C For an operation that takes argument from library function D None of these 1 44) In C++...A One B Two C Zero 39) The objects are .. ? A A concep B Abstraction C Thing D All of above 41) The mechanism by which the data and functions are bound together with an object definition ? A Inheritance B Abstraction C Polymorphism D Encapsulation 42) The process of creating instances from classes ? A Integrity B Instantation C Inheritance D Generalization 1 43) Override is a method .... if all their attribute values are identical ? A Identical B Distinct C Same D None 1 40) Object is. setw is... ? A Initialization Operato B Conditional Operator C Memory allocation Operator ...... a function contained with in a class is called ? A In built functio B User defined function C Member function D None of these 1 45) In C++......

D Field with Operator 1 46) A template can be used to create a family of ? A Classe B Functions C Class and function D None of these 1 47) In C++. This is known as ? A Global function B Function overloading C Inheritance D All of above 1 2 48) Which of the following is an object oriented programming ? A Real time syste B AI and expert systems C Neural networks and parallel programming D All of above 49) Function overloading is a type of A polymorphism B inheritance C classes D data hiding 50) By-default members of a class are- A private B public C both D none of above Answer Key- 1 A 2 C 3 A 4 A 5 C 6 C 7 A . we can use the same function name to create functions that perform a variety of different tasks.

8 D 9 C 10 A 11 D 12 C 13 C 14 A 15 D 16 D 17 B 18 A 19 C 20 C 21 B 22 A 23 C 24 A 25 C 26 C 27 B 28 A 29 B 30 D 31 C 32 C 33 D 34 D 35 B 36 A 37 A 38 A 39 C 40 D 41 D 42 A 43 B 44 D 45 C 46 A 47 D 48 B 49 A 50 A .