Principles and Programming MCQs > FREE SET - 3

1. A section of code to which control is transferred when a processor is interrupted is known as
A M
B SVC
C IP
D MDR

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

2. Which of the following type of class allows only one object of it to be created in C++?
A Virtual class
B Abstract class
C Singleton class
D Friend class

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

3. Which of the following is not a type of constructor in C++?
A Copy constructor
B Friend constructor
C Default constructor
D Parameterized constructor

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

4. Which of the following statements is correct in C++?
A Base class pointer cannot point to derived class.
B Derived class pointer cannot point to base class.
C Pointer to derived class cannot be created.
D Pointer to base class cannot be created.

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

5. Which of the following is not the member of class in C++?
A Static function
B Friend function
C Const function
D Virtual function

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

6. Which of the following concepts means determining at runtime what method to invoke in C++?
A Data hiding
B Dynamic Typing
C Dynamic binding
D Dynamic loading

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

7. Which of the following term is used for a function defined inside a class in C++?
A Member Variable
B Member function
C Class function
D Classic function

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

8. Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?
A Call by value
B Call by reference
C Default arguments
D Call by pointer

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

9. How many instances of an abstract class can be created in C++?
A 1
B 5
C 13
D 0

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

10. Which of the following cannot be friend in C++?
A Function
B Class
C Object
D Operator function

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

11. Which of the following concepts of OOPS means exposing only necessary information to client?
A Encapsulation
B Abstraction
C Data hiding
D Data binding

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

12. Why reference is not same as a pointer in C++?
A A reference can never be null.
B A reference once established cannot be changed.
C Reference doesn't need an explicit dereferencing mechanism.
D All of the above.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

13. cout is a/an __________ in C++.
A operator
B function
C object
D macro

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

14. Which of the following concepts provides facility of using object of one class inside another class in C++?
A Encapsulation
B Abstraction
C Composition
D Inheritance

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

15. How many types of polymorphisms are supported by C++?
A 1
B 2
C 3
D 4

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

16. Which of the following is an abstract data type in C++?
A int
B double
C string
D Class

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

17. Which of the following concepts means adding new components to a program as it runs in C++?
A Data hiding
B Dynamic typing
C Dynamic binding
D Dynamic loading

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

18. Which of the following statement is correct in C++?
A A constructor is called at the time of declaration of an object.
B A constructor is called at the time of use of an object.
C A constructor is called at the time of declaration of a class.
D A constructor is called at the time of use of a class.

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

19. Which of the following correctly describes overloading of functions in C++?
A Virtual polymorphism
B Transient polymorphism
C Ad-hoc polymorphism
D Pseudo polymorphism

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

20. Which of the following approach is adapted by C++?
A Top-down
B Bottom-up
C Right-left
D Left-right

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

21. Which of the following is correct about function overloading in C++?
A The types of arguments are different.
B The order of argument is different.
C The number of argument is same.
D Both A) and B)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

22. Which of the following is correct about class and structure in C++?
A Class can have member functions while structure cannot.
B Class data members are public by default while that of structure are private.
C Pointer to structure or classes cannot be declared.
D Class data members are private by default while that of structure are public by default.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

23. Which of the following concepts means wrapping up of data and functions together in C++?
A Abstraction
B Encapsulation
C Inheritance
D Polymorphism

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

24. Which of the following concepts means waiting until runtime to determine which function to call in C++?
A Data hiding
B Dynamic casting
C Dynamic binding
D Dynamic loading

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

25. How "Late binding" is implemented in C++?
A Using C++ tables
B Using Virtual tables
C Using Indexed virtual tables
D Using polymorphic tables

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

26. Which of the following operator is overloaded for object cout in C++?
A >>
B <<
C +
D =

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

27. Which of the following is the correct class of the object cout in C++?
A iostream
B istream
C ostream
D ifstream

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

28. Which of the following cannot be used with the keyword virtual in C++?
A class
B member functions
C constructor
D destructor

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

29. Which of the following functions are performed by a constructor in C++?
A Construct a new class
B Construct a new object
C Construct a new function
D Initialize objects

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

30. Which of the following problem causes an exception in C++?
A Missing semicolon in statement in main().
B A problem in calling function.
C A syntax error.
D A run-time error.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

31. Which one of the following options is correct about the C++ statement given below? The compiler checks the type of reference in the object and not the type of object.
A Inheritance
B Polymorphism
C Abstraction
D Encapsulation

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

32. Which of the following is the correct way of declaring a function as constant in C++?
A const int ShowData(void) { /* statements */ }
B int const ShowData(void) { /* statements */ }
C int ShowData(void) const { /* statements */ }
D Both A and B

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

33. Which of the following concepts is used to implement late binding in C++?
A Virtual function
B Operator function
C Const function
D Static function

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

34. Which of the following statement is correct in C++?
A C++ allows static type checking.
B C++ allows dynamic type checking.
C C++ allows static member function be of type const.
D Both A and B.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

35. Which of the following factors supports the statement that reusability is a desirable feature of a language?
A It decreases the testing time.
B It lowers the maintenance cost.
C It reduces the compilation time.
D Both A) and B)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

36. Which of the following ways are legal to access a class data member using this pointer in C++?
A this->x
B this.x
C *this.x
D *this-x

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

37. Which of the following is a mechanism of static polymorphism in C++?
A Operator overloading
B Function overloading
C Templates
D All of the above

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

38. What happens if the base and derived class contains definition of a function with same prototype in C++?
A Compiler reports an error on compilation.
B Only base class function will get called irrespective of object.
C Only derived class function will get called irrespective of object.
D Base class object will call base class function and derived class object will call derived class function.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

39. Which of the following are available only in the class hierarchy chain in C++?
A Public data members
B Private data members
C Protected data members
D Member functions

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

40. Which of the following is not a type of inheritance in C++?
A Multiple
B Multilevel
C Distributive
D Hierarchical

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

41. Which of the following operators cannot be overloaded in C++?
A []
B ->
C ?:
D *

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

42. In which of the following a virtual call is resolved at the time of compilation in C++?
A From inside the destructor.
B From inside the constructor.
C From inside the main().
D Both A) and B)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

43. Which of the following statements regarding C++ inline functions is correct?
A It speeds up execution.
B It slows down execution.
C It increases the code size.
D Both A) and C)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

44. Which of the following header file includes definition of cin and cout in C++?
A istream.h
B ostream.h
C iomanip.h
D iostream.h

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

45. Which of the following keyword is used to overload an operator in C++?
A overload
B operator
C friend
D override

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

46. What will happen if a class is not having any name in C++?
A It cannot have a destructor.
B It cannot have a constructor.
C It is not allowed.
D Both A) and B)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

47. Which inheritance type is used in the C++ class given below?
class A : public X, public Y
{}
A Multilevel inheritance
B Multiple inheritance
C Hybrid inheritance
D Hierarchical Inheritance

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

48. Which of the following is an invalid visibility label while inheriting a class in C++?
A public
B private
C protected
D friend

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

49. Which one of the following options is correct in C++?
A Friend function can access public data members of the class.
B Friend function can access protected data members of the class.
C Friend function can access private data members of the class.
D All of the above.

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

50. Which of the following statements is correct in C++?
A Classes cannot have data as protected members.
B Structures can have functions as members.
C Class members are public by default.
D Structure members are private by default.

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.


No comments:

Post a Comment

Your Feedback is hearty Requested to make the MCQs Collection better.

Popular Posts