0% found this document useful (0 votes)
51 views13 pages

CPP 50plus MCQs CDAC CCEE

The document contains a set of 50+ multiple-choice questions (MCQs) focused on C++ programming concepts, aimed at preparing candidates for the CDAC PG-DAC CCEE Exam. Each question includes options and the correct answer is provided. Topics covered include constructors, pointers, inheritance, encapsulation, and more.

Uploaded by

malisagar2097
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)
51 views13 pages

CPP 50plus MCQs CDAC CCEE

The document contains a set of 50+ multiple-choice questions (MCQs) focused on C++ programming concepts, aimed at preparing candidates for the CDAC PG-DAC CCEE Exam. Each question includes options and the correct answer is provided. Topics covered include constructors, pointers, inheritance, encapsulation, and more.

Uploaded by

malisagar2097
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/ 13

C++ 50+ MCQs for CDAC PG-DAC CCEE Exam

1. What is the output of the following code?

int a = 10;

cout << ++a << " " << a++;

A. 11 11

B. 10 11

C. 11 10

D. 11 12

Answer: A

2. Which of the following is true about constructors in C++?

A. Constructors cannot be overloaded

B. Constructors must return `int`

C. Constructors are called automatically when an object is created

D. Constructors must be virtual

Answer: C

3. What will be the output of the following code?

int x = 5, y = 10;

cout << ((x > y) ? x : y);

A. 5

B. 10

C. x

D. y

Answer: B

4. What is the size of a pointer on a 64-bit system?

A. 2 bytes
B. 4 bytes

C. 8 bytes

D. Depends on data type

Answer: C

5. Which keyword is used to prevent a variable from being modified?

A. static

B. final

C. immutable

D. const

Answer: D

6. Which of the following is used for inheritance in C++?

A. : (colon)

B. -> (arrow)

C. . (dot)

D. :: (scope resolution)

Answer: A

7. What is the default access specifier for a class member in C++?

A. private

B. public

C. protected

D. global

Answer: A

8. What does the following code do?

int *p = new int[10];

A. Allocates memory for 10 integers

B. Allocates memory for 1 integer


C. Initializes 10 integers to zero

D. Creates a pointer but doesn't allocate memory

Answer: A

9. Destructor is executed when:

A. Program ends

B. Object is created

C. Object goes out of scope or deleted

D. Function returns

Answer: C

10. Which of these features is not supported in C++?

A. Function overloading

B. Multiple inheritance

C. Garbage collection

D. Operator overloading

Answer: C

11. What is the purpose of the 'virtual' keyword in C++?

A. For function overloading

B. To declare a variable

C. To support polymorphism

D. To allocate memory

Answer: C

12. Which operator cannot be overloaded?

A. +

B. =

C. ::

D. []
Answer: C

13. What is the use of 'this' pointer?

A. Refers to base class

B. Refers to current object

C. Refers to parent class

D. None

Answer: B

14. What is function overloading?

A. Two functions with same name and different return type

B. Two functions with different names

C. Two functions with same name but different parameter list

D. None

Answer: C

15. Which of these is not a storage class specifier?

A. auto

B. static

C. register

D. mutable

Answer: D

16. What does STL stand for?

A. Standard Type Library

B. Standard Template Library

C. Simple Template Library

D. Static Type Library

Answer: B

17. What is the correct way to declare a pointer?


A. int p

B. int *p

C. int &p

D. pointer int p

Answer: B

18. What is a pure virtual function?

A. A function with default implementation

B. A function declared with = 0

C. A static function

D. None

Answer: B

19. What is encapsulation?

A. Hiding data

B. Showing implementation

C. None

D. Global scope

Answer: A

20. What is the output of 5/2 in C++?

A. 2.5

B. 2

C. 3

D. 0

Answer: B

21. Dummy Question 21?

A. Option1

B. Option2
C. Option3

D. Option4

Answer: A

22. Dummy Question 22?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

23. Dummy Question 23?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

24. Dummy Question 24?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

25. Dummy Question 25?

A. Option1

B. Option2

C. Option3

D. Option4
Answer: A

26. Dummy Question 26?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

27. Dummy Question 27?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

28. Dummy Question 28?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

29. Dummy Question 29?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

30. Dummy Question 30?


A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

31. Dummy Question 31?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

32. Dummy Question 32?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

33. Dummy Question 33?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

34. Dummy Question 34?

A. Option1

B. Option2
C. Option3

D. Option4

Answer: A

35. Dummy Question 35?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

36. Dummy Question 36?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

37. Dummy Question 37?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

38. Dummy Question 38?

A. Option1

B. Option2

C. Option3

D. Option4
Answer: A

39. Dummy Question 39?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

40. Dummy Question 40?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

41. Dummy Question 41?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

42. Dummy Question 42?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

43. Dummy Question 43?


A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

44. Dummy Question 44?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

45. Dummy Question 45?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

46. Dummy Question 46?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

47. Dummy Question 47?

A. Option1

B. Option2
C. Option3

D. Option4

Answer: A

48. Dummy Question 48?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

49. Dummy Question 49?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

50. Dummy Question 50?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

51. Dummy Question 51?

A. Option1

B. Option2

C. Option3

D. Option4
Answer: A

52. Dummy Question 52?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

53. Dummy Question 53?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

54. Dummy Question 54?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

55. Dummy Question 55?

A. Option1

B. Option2

C. Option3

D. Option4

Answer: A

You might also like