0% found this document useful (0 votes)
44 views7 pages

MCQ CPP

Mcq file

Uploaded by

normanjacobe2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views7 pages

MCQ CPP

Mcq file

Uploaded by

normanjacobe2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

Number of keywords are available in c++ are _______


1. 32
2. 27
3. 31
4. 63
Answer: 4

2. ___________ is only language which is purely OOP Language.


1. Smalltalk
2. CPP
3. Simula
4. Java
Answer: 1

3. ________ is frist OOP Language in 1960.


1. Smalltalk
2. CPP
3. Simula
4. Java
Answer: 3

4. Function having same name but differs either in different number of arguments or type of
arguments or order of arguments such process of writing function is called function ________
1. overloading
2. overriding
3. both 1 and 2
4. none of above
Answer: 1

5. operator which is used with cin is called as operator ________(>>)


1. extraction
2. insertion
3. in
4. out
Answer: 1

6. operator which is used with cout is called as _________operator <<


1. extraction
2. insertion
3. in
4. out
Answer: 2

7. The values stored in data members of the object called as _________ of object.
1. state
2. behavior
3. identity
4. none of above
Answer: 1

8. __________is decided by the member functions.


1. state
2. behavior
3. identity
4. none of above
Answer: 2
9. Default arguments should be given in ___________
1. right to left order
2. left to right order
3. depends of compiler
4. none of above
Answer: 1

10. Size of object of empty class is always ______


1. 1 btye
2. 8 byte
3. 8 bits
4. 4 bytes
5. both 1 and 3
Answer: 5

11. Every function may not be replace by complier , rather it avoids replacement in certain
cases like ____ may not be replaced
1. function containing switch , loop
2. recursion
3. both 1 and 2
4. none of above
Answer: 3

12. __________ is 1st POP Language


1. FORTRON
2. PASCAL
3. c
4. NONE OF ABOVE
Answer: 1

13. ____________ is frist object based language.


1. Ada
2. visual basic
3. module2
4. none of above
Answer: 1

14. C++ supports all data types provided by C language and C++ adds data types
1. bool
2. wchar_t
3. both 1 and 2
4. none of above
Answer: 3

15. when the call to the function resolved at compile time it is called as compile time
polymorphism. And it is achieved by using ___________.
1. function overloading
2.operator overloading
3.function overriding
4.both 1 and 2
Answer: 4

16. Removal of small object do not affect big object it is called as_____
1. association
2. aggregation
3. containment
4. none of above
Answer: 1
17. Removal of small object affects big object it is called as__________
1. association
2. aggregation
3. containment
4. none of above
Answer: 2

18. In c++ by default mode of inheritance is ____________


1. private
2. protected
3. public
4. none of above
Answer: 1

19. function which gets called depending on type of object rather than type of pointer such
type of function is called as_____.
1. virtual function
2. static function
3. const function
4. global function
Answer: 1

20. Class which contains at least one pure virtual function such type of class is called as
called ______
1. abstract class
2. concreate class
3. both 1 and 2
4. none of above
Answer: 1

21. Storing address of derived class object into bas class pointer. Such concept is called as
________
1. up casting.
2. down casting
3. object slicing
4. none of above
Answer: 1

22. storing address of base class object into derived class pointer is called as _________
1. up casting.
2. down casting
3. object slicing
4. none of above
Answer: 2

23. when we assign derived class object to the base class object at that time base class
portion which is available in derived class object is assign to the base class object. Such
slicing (cutting) of base class portion from derived class object is called __________
1. up casting.
2. down casting
3. object slicing
4. none of above
Answer: 3
24. pointer pointing to memory which is not available such type of pointer is called as _______
1. dangling pointer.
2. null pointer
3. huge pointer
4. far pointer
Answer: 1

25 . which of the following is called automatically each time object is created?


1. mutator
2. constructor
3. destructor
4. copy constructor
Answer: 2

26. which of the following statement is true about abstract class?


1. An abstract class can be instantiated using new operator
2. An abstarct class is designed only to be inherited by other classes
3. An abstract class can not have data members and member function declarations
4. abstract class can not have constructor and destructor.
Answer: 2

27. when object goes out of scope which function is automatically invoked?
1. static
2. friend
3. exception handler
4. destructor
5. constructor
answer : 4

28. The mechanism by which one class aquries the properties of another class is called
as_____
1. encapsulation
2. data hiding
3. abstraction
4. inheritance
Answer: 4

29. when a derived class inherits from more than one base classes it is called as ____
1. multilevel inheritance
2. single inheritance
3. multiple inheritance
4. hybrid inheritance
5. hierarchical inheritance
Answer: 3

30. one base class more than one dreived classes such type of inheritance is called as ___
1. multilevel inheritance
2. single inheritance
3. multiple inheritance
4. hybrid inheritance
5. hierarchical inheritance
Answer: 5
31. when single inheritance have mutiple levels it is called as ________
1. multilevel inheritance
2. single inheritance
3. multiple inheritance
4. hybrid inheritance
5. hierarchical inheritance
Answer: 1

32. one base class have only one derived class is called as______
1. multilevel inheritance
2. single inheritance
3. multiple inheritance
4. hybrid inheritance
5. hierarchical inheritance
Answer: 2

33. which statement is not correct about static member function of the class?
1. static member function can be called by object of that class
2. static member function can be called without creating object of that class ie by class name
only
3. static member function can be called by non static member function.
4. static function can not access only static data member
Answer: 4

34. which of the following not a key componet of oops?


1. inheritance
2. polymorphism
3. encapsulation
4. virtualization
Answer : 4

35. a class define in another class is called as


1. nested class
2. inheritance
3. encapsulation
4. containship
Answer: 1

36. which keyword is use to refer the current object of class


1.this
2.static
3.friend
4.abstract
5.const
Answer: 1

37 .statements:
i have many roles in life teacher, employee, student, cricket player and many more.
Identify the object oriented conecpt used in above statement.
1. abstraction
2. polymorphism
3. data hiding
4. composition
5. inheritance
Answer: 2
38. which of the following statement is false with respect to default constructor
1. The default constructor does not take any argruments.
2. the default constructor can be use as a copy constructor
3.ther default constructor is used to intialize object
4. the compliler will genrate its own default constructor when programer dont provide any
type of constructor.
Answer: 2

39. #include<iostream>
using namespace std;
int main(int argc , char *argv[], char *envp[])
{
int a=5;
int &b=a;
int c=10;
b=c;
cout<<a<< " "<<b<<endl;
c=20;
cout<<a<< " "<<b<<endl;
return 0;
}
1. 10 10
20 20
2. 10 5
20 20
3. 5 10
20 20
4. 10 10
10 10
Answer :4

40 ____ is a member function that is declared with in base class and redefined by a derived
class.
1. constructor
2. destructor
3. static function
4. friend function
5. virtual function
Answer: 5

41. every non const member function of a class is a______


1. constructor
2. destructor
3. mutator
4. friend
Answer: 3

42 . class is a _________
1. build in type
2. user define type
3. reference type
4. premitive type
Answer: 2
43. which of the following statments not true about destructor
1. it is a member function
2. it is used to finalize object
3. it does not have any return value
4. it does not have any parameter
5. it accept class object as parameter
Answer : 5

44. which of the following statments true about destructor


1. it is a member function
2. it is used to finalize object
3. it does not have any return value
4. it does not have any parameter
5. all of above
Answer : 5

45. what will be correct declaration for calculate() as a pure virtual function?
1. virtual void calculate();
2. virtual void calculate()=0;
3. void calculate()=0;
4. virtual calculate();
Answer: 2

46. to eliminate the side effcets of macro we can use


1. inline function
2. static function
3. abstrat class
4. virtual function
5. pure virtal function
Answer: 1

[email protected] 9881144174

You might also like