3. Programming Language and Its Applications

1. Which of the following is not a valid token in C programming?

2. In C, which operator is used for dereferencing a pointer?

3. Which of the following is true about a recursive function?

4. What is the result of the following expression in C: (x>y)?x:y?

5. What does the "sizeof" operator in C do?

6. What is the correct syntax for declaring a function in C?

7. Which of the following is true about arrays in C?

8. Which of the following is a feature of C pointers?

9. What does the "&" operator do in C?

10. What is the output of the following C code: int arr[2] = 1, 2; and \text{printf("%d", arr[0]);}?

11. Which of the following is the correct way to define a structure in C?

12. Which of the following is true about unions in C?

13. What is the purpose of a function pointer in C?

14. What does the "return" keyword do in C?

15. Which of the following is an example of file handling in C?

16. What is the output of the following C code: \text{printf("%d", 5 + 3 * 2);} ?

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

18. What is the main advantage of using function overloading in C++?

19. Which of the following is used to implement polymorphism in C++?

20. In C++, what does "this" pointer refer to?

21. Which of the following access specifiers allows members to be accessed only within the same class?

22. Which of the following is true about a pure virtual function in C++?

23. Which of the following is true about exception handling in C++?

24. What does the term "template" refer to in C++?

25. In C++, which of the following defines a template function?

26. In C, which of the following is used to declare a constant value?

27. What does the "fseek()" function do in C?

28. Which of the following is true about function overloading in C++?

29. What is the purpose of the "new" keyword in C++?

30. Which of the following is true about static members of a class in C++?

31. Which of the following is true about exception handling in C++?

32. Which of the following is true about passing a structure to a function in C?

33. What is the purpose of the "delete" operator in C++?

34. Which of the following is an advantage of inheritance in C++?

35. Which of the following is true about virtual functions in C++?

36. What is the purpose of "friend" functions in C++?

37. Which of the following is correct for file input operations in C?

38. What is the syntax for accessing an element of a structure in C?

39. Which of the following is true about a destructor in C++?

40. What is the output of the following C++ code? int a = 5; float b = 2.5; cout << a + b;

41. Which of the following is true about the "this" pointer in C++?

42. In C++, which function is called when an object is created?

43. Which of the following is true about object slicing in C++?

44. Which of the following is true about default arguments in C++?

45. What is the result of the following operation in C: 5 / 2?

46. Which of the following is used for input and output operations in C++?

47. Which of the following is used to allocate memory dynamically in C?

48. What is the purpose of a function template in C++?

49. In C++, which operator is used for memory allocation?

50. Which of the following is a correct syntax for defining a class in C++?

51. Which of the following operators can be overloaded in C++?

52. What is the main advantage of using a destructor in C++?

53. Which of the following is used to create an object of a class in C++?

54. What does the "delete[]" operator do in C++?

55. Which of the following is true about inline functions in C++?

56. In C++, what does the term "friend class" mean?

57. Which of the following is true about file handling in C?

58. What is the main difference between a structure and a union in C?

59. In C++, what is the default access specifier for members of a class?

60. Which of the following is a feature of dynamic memory allocation in C?

61. What is the output of the following C++ code? int arr[2] = 5, 10; cout << arr[1];

62. Which of the following is used to read a character from the keyboard in C?

63. What is the default behavior of the "new" keyword in C++ when allocating memory?

64. Which of the following is the correct syntax for accessing a member of a class object in C++?

65. In C, what is the correct syntax to declare a function that returns an integer and takes no parameters?

66. Which of the following is a type of loop in C?

67. Which of the following is true about a copy constructor in C++?

68. What is the main purpose of the "throw" keyword in C++?

69. Which function in C++ is used to allocate memory for a single object dynamically?

70. In C++, which type of constructor is called when an object is created with no arguments?

71. Which of the following is correct for passing an array to a function in C?

72. Which of the following is an example of a pure virtual function in C++?

73. In C++, what is the result of dividing an integer by zero?

74. What is the main purpose of the 'this' pointer in C++?

75. Which operator is used to access a class member using a pointer in C++?

76. Which of the following is true about polymorphism in C++?

77. In C++, which of the following statements is correct about destructors?

78. Which of the following types can be used as function arguments in C++?

79. Which of the following is the correct syntax for a reference variable in C++?

80. Which of the following is correct for memory allocation in C++?

81. What is the output of the following code in C++? int arr[3] = 5, 10, 15; cout << arr[1];

82. Which of the following is true about function overloading in C++?

83. What does the "sizeof" operator do in C and C++?

84. Which of the following is true about "try" and "catch" blocks in C++?

85. Which of the following is true about inheritance in C++?

86. Which of the following statements is true about arrays in C?

87. Which of the following is true about a constructor in C++?

88. What is the purpose of the "void" keyword in C++?

89. Which of the following is correct about the scope of a variable in C and C++?

90. Which of the following is true about static members of a class in C++?

91. Which of the following is true for the malloc() function in C?

92. What does the const keyword do in C++ when applied to a member function?

93. In C++, which of the following is true about a virtual destructor?

94. Which of the following is a feature of the new operator in C++?

95. Which of the following is true about the friend keyword in C++?

96. What is the result of calling the delete[] operator on a pointer to a single object in C++?

97. In C++, what is the main difference between a struct and a class?

98. What is the purpose of a this pointer in C++?

99. In C++, what is the main purpose of the operator keyword?

100. What is the size of a bool in C++?

101. Which of the following is a valid way to access a member of a structure using a pointer in C?

102. What is the output of the following code in C++? int x = 10; cout << ++x;

103. Which of the following is used to store a value that is constant in C++?

104. In C++, what does the term "dynamic binding" refer to?

105. Which of the following is true about function overloading in C++?

106. In C++, which of the following is the correct way to allocate memory for an array of 10 integers using new?

107. What is the default access specifier for members of a class in C++?

108. Which of the following is the correct way to define a pure virtual function in C++?

109. Which of the following describes the concept of "destructor" in C++?

110. In C++, which type of function allows you to specify default arguments?

111. Which of the following C++ features is used to define a template for a function that works with different data types?

112. What is the correct syntax for declaring a pointer to an integer in C?

113. Which of the following operators is used for memory allocation in C?

114. In C++, what is the purpose of the explicit keyword in front of a constructor?

115. Which of the following is true about function pointers in C and C++?

116. Which of the following keywords is used in C++ to prevent a function from being overridden in a derived class?

117. What does the sizeof() operator return in C and C++?

118. Which of the following describes "dynamic memory allocation" in C?

119. In C++, which of the following can be used to define a constant member variable?

120. Which of the following is an example of function overloading in C++?

121. In C++, what is the result of trying to call a non-virtual function in a derived class using a base class pointer?

122. Which of the following is the correct syntax for defining an array of structures in C?

123. Which of the following allows you to create an object at runtime in C++?

124. In C++, what is the result of calling a constructor with arguments when no matching constructor is defined in a class?

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

126. Which C++ keyword is used to define a class method that can only be accessed through an object?

127. Which of the following is true about polymorphism in C++?

128. What is the purpose of a static function in C++?

129. Which of the following is the correct syntax to create a reference to an integer variable in C++?

130. Which of the following is the correct way to call a function in C++ using a reference argument?

131. Which of the following functions in C++ can be used to allocate memory for an array of objects dynamically?

132. Which of the following is true about the scope of variables in C++?