Smart Future Point

C++ MCQ

1. What is the default value of an int variable in C++?



2. Which of the following is not a primitive data type in C++?



3. What is the size of a char in C++?



4. Which keyword is used to define a constant variable in C++?



5. Which operator is used for concatenating strings in C++?



6. What will be the output of std::cout << 10 / 3;?


7. Which of the following is used to take input in C++?


8. How do you declare an array in C++?


9. What is the correct syntax to create an object in C++?


10. What is the purpose of the this keyword in C++?


11. Which of the following is a valid way to comment in C++?


12. What is the output of the following code: std::cout << "Hello" << 5;?


13. Which of the following is used to handle exceptions in C++?


14. What does a C++ class hold?


15. Which of the following is a feature of Object-Oriented Programming in C++?


16. What is the purpose of the destructor in C++?


17. Which of the following is the correct way to declare a pointer in C++?


18. What is the output of the following code: std::cout << (5 + 3) * 2;?


19. Which of the following is used to define a function in C++?


20. What is the purpose of the static keyword in C++?


21. What is the correct syntax to output "Hello World" in C++?


22. Which header file is required for using 'cout' in C++?


23. Which of the following is the correct way to declare a constant in C++?


24. Which operator is used to allocate memory dynamically in C++?


25. What is the size of 'int' data type (typically) in C++?


26. What is the output of: cout << 5 / 2;


27. Which of the following is used to define a class in C++?


28. Which of the following correctly initializes an array in C++?


29. What is the keyword used to inherit a class in C++?


30. Which of the following is the correct destructor declaration in C++?


31. Which of the following is not a C++ access specifier?


32. Which of the following supports function overloading in C++?


33. What is the default return type of functions in C++ if not specified?


34. What is a constructor in C++?


35. What will 'cin' do in C++?


36. Which loop checks the condition after executing the loop body?


37. What is the scope resolution operator in C++?


38. What does the 'this' pointer point to in C++?


39. What is the extension of a C++ source file?


40. Which of the following allows you to reuse code in C++?


41. What is polymorphism in C++?


42. Which operator is used to allocate memory dynamically in C++?


43. Which of the following is a valid identifier in C++?


44. What is the size of 'int' on most 32-bit systems in C++?


45. Which feature in C++ is used to hide internal object details?


46. Which of the following header files is used for input/output in C++?


47. What is the purpose of the 'return 0;' statement in C++ main() function?


48. What is a reference variable in C++?


49. Which of these is not a feature of Object Oriented Programming in C++?


50. Which concept allows treating derived class objects as base class objects?


C++ Language Short Questions

1. What is C++?

2.What are the main features of C++?

3. What is a class in C++?

4. What is an object in C++?

5.What is inheritance in C++?

6.What is polymorphism in C++?

7. What is encapsulation in C++?

8. What are templates in C++?

9. What is a constructor in C++?

10. What is a destructor in C++?

11. What is inheritance in C++?

12. What is the difference between class and struct in C++?

13. What are access specifiers in C++?

14. What is function overloading in C++?

15. What is operator overloading in C++?

16. What is the use of 'this' pointer in C++?

17. Explain virtual functions in C++.

18. What is the difference between compile time and run time polymorphism?

19. What is a pure virtual function in C++?

20. What is the difference between a pointer and a reference?

21. What is the use of 'namespace' in C++?

22. What are inline functions in C++?

23. What is the Standard Template Library (STL) in C++?

24. What are iterators in C++ STL?

25. What is the difference between 'new' and 'malloc' in C++?

26. Explain exception handling in C++.

27. What are smart pointers in C++?

28. What is the difference between stack and heap memory?

29. What is the use of static keyword in C++?

30. How is memory managed in C++?

31. What is multiple inheritance in C++?

32. What is multilevel inheritance in C++?

33. What is a virtual base class in C++?

34. How does dynamic memory allocation work in C++?

35. What is the role of the 'friend' keyword in C++?

36. What is the difference between shallow copy and deep copy?

37. What is a copy constructor in C++?

38. Explain the role of the 'mutable' keyword in C++.

39. What are the types of polymorphism in C++?

40. What is the difference between 'delete' and 'delete[]' in C++?

41. What are the advantages of OOP in C++?

42. What are the different types of inheritance supported by C++?

43. What is the difference between abstraction and encapsulation?

44. How are C++ and C different?

45. What is the function of the 'auto' keyword in C++11 and later?

46. What is RAII (Resource Acquisition Is Initialization) in C++?

47. What are lambda expressions in C++?

48. What is type casting in C++?

49. Explain 'const' keyword usage in C++.

50. What is the difference between 'struct' and 'union' in C++?

Coumputer Course

Popular Courses

(123)
Web Development
(123)
FULL STACK JAVA
PROGRAMING
(123)
PYTHON PROGRAMING
smartfuturepoint