C and C++ Programing
1.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
2.
Which operator is used to perform bitwise NOT in C++?
TRE4 C and C++ Quiz practice set 2
3.
Write the output of the following program: int a[ ] = {1,2,3,} *p;
TRE4 C and C++ Quiz practice set 1
4.
Assume size of an integer as 4 bytes. What is the output of the above program?
TRE4 C and C++ Quiz practice set 1
5.
Which language is better for writing structured code?
TRE4 C and C++ Quiz practice set 3
6.
Which of the following is an example of a server-side scripting language commonly used in web applications?
TRE4 C and C++ Quiz practice set 1
7.
Which of the following approaches is used by C++?
TRE4 C and C++ Quiz practice set 2
8.
Which language does a browser use to display information from the World Wide Web?
TRE4 C and C++ Quiz practice set 3
9.
What is virtual inheritance in C++?
TRE4 C and C++ Quiz practice set 2
10.
Select the true statement for compiler.
TRE4 C and C++ Quiz practice set 3
11.
What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr;
TRE4 C and C++ Quiz practice set 2
12.
Which of the following is not a valid variable name in most programming languages?
TRE4 C and C++ Quiz practice set 3
13.
What is the difference between delete and delete[] in C++?
TRE4 C and C++ Quiz practice set 2
14.
If a semicolon is not used at the end of a statement, what message will be displayed by C++?
TRE4 C and C++ Quiz practice set 3
15.
What happens if the following program is executed in C and C++? int new=5; printf("%d", new);
TRE4 C and C++ Quiz practice set 2
16.
Which shortcut keys are used to compile and run a program in Turbo C++?
TRE4 C and C++ Quiz practice set 3
17.
What is the value of p in the following C++ code snippet?
TRE4 C and C++ Quiz practice set 2
18.
Which of the following is a user-defined header file extension used in C++?
TRE4 C and C++ Quiz practice set 3
19.
The C++ code which causes abnormal termination or behaviour of a program should be written under _____ block.
TRE4 C and C++ Quiz practice set 2
20.
What will happen if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr;
TRE4 C and C++ Quiz practice set 3
21.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
22.
Which of the following correctly declares an array in C++?
TRE4 C and C++ Quiz practice set 3
23.
Pick the incorrect statement about inline functions in C++.
TRE4 C and C++ Quiz practice set 2
24.
What will be the output of the given C++ code that attempts to concatenate character arrays using the + operator?
TRE4 C and C++ Quiz practice set 3
25.
What is abstract class in C++?
TRE4 C and C++ Quiz practice set 2
26.
How do structures and classes in C++ differ?
TRE4 C and C++ Quiz practice set 3
27.
Which of the following constructors is provided by the C++ compiler if not defined in a class?
TRE4 C and C++ Quiz practice set 2
28.
What is the use of ios::trunc mode in C++?
TRE4 C and C++ Quiz practice set 3
29.
How do structures and classes in C++ differ?
TRE4 C and C++ Quiz practice set 2
30.
Which of the following statements is/are correct about C++ file opening modes?
TRE4 C and C++ Quiz practice set 3
31.
Which of the following is the original creator of the C++ language?
TRE4 C and C++ Quiz practice set 2
32.
The correct statement for a function that takes a pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to an integer is
TRE4 C and C++ Quiz practice set 3
33.
Which of the following is the correct syntax to read the single character to console in the C++ language?
TRE4 C and C++ Quiz practice set 2
34.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
35.
Which of the following gives the nth element of the Array?
TRE4 C and C++ Quiz practice set 2
36.
Which is correct syntax of inheritance in C++?
TRE4 C and C++ Quiz practice set 3
37.
How many types of the array are there in the C++ programming language?
TRE4 C and C++ Quiz practice set 2
38.
Which one of the following is the correct definition of the is_array() function in PHP?
TRE4 C and C++ Quiz practice set 3
39.
In C++, for what purpose is the rank() used?
TRE4 C and C++ Quiz practice set 2
40.
Which of the following statements is correct about a class and an object in C++?
TRE4 C and C++ Quiz practice set 3
41.
What is the scope of the variable declared in a user-defined function?
TRE4 C and C++ Quiz practice set 2
42.
Which of the following can be used to create an abstract class in C++?
TRE4 C and C++ Quiz practice set 3
43.
Which one of the following is the correct definition of the is_array() function in C++?
TRE4 C and C++ Quiz practice set 2
44.
Which of the following statements is correct about the C++ programming language?
TRE4 C and C++ Quiz practice set 3
45.
Which of the following statements is true about new and malloc? I. The new is a type of operator while malloc is a kind of function. II. The new invokes a constructor, whereas malloc does not invoke the constructor. III. The malloc returns void pointer and also needed to typecast whereas new returns required pointer.
TRE4 C and C++ Quiz practice set 2
46.
Which feature of OOP is indicated by the following code?
TRE4 C and C++ Quiz practice set 3
47.
What will happen if in a C++ program, a class has no name?
TRE4 C and C++ Quiz practice set 2
48.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
49.
Assume that an integer occupies 4 bytes. What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
50.
Which of the following is primarily a procedural programming language that supports structured programming?
TRE4 C and C++ Quiz practice set 3
51.
Which of the following is primarily used for server-side scripting in web applications?
TRE4 C and C++ Quiz practice set 1
52.
Which programming paradigm is primarily supported by C++?
TRE4 C and C++ Quiz practice set 2
53.
What is the full form of HTML?
TRE4 C and C++ Quiz practice set 3
54.
Which problem is commonly solved by virtual inheritance in C++?
TRE4 C and C++ Quiz practice set 2
55.
What is the primary function of a compiler?
TRE4 C and C++ Quiz practice set 3
56.
Which operator is used in C++ to dynamically allocate memory for a single object?
TRE4 C and C++ Quiz practice set 2
57.
What is an identifier in programming?
TRE4 C and C++ Quiz practice set 3
58.
Which C++ operator is used to allocate memory for an array dynamically?
TRE4 C and C++ Quiz practice set 2
59.
What is the primary purpose of a semicolon in C++?
TRE4 C and C++ Quiz practice set 3
60.
Which of the following can be used as an identifier in both C and C++?
TRE4 C and C++ Quiz practice set 2
61.
Which shortcut key is used to compile a program in classic Turbo C++?
TRE4 C and C++ Quiz practice set 3
62.
What is the primary purpose of a header file in C++?
TRE4 C and C++ Quiz practice set 3
63.
Which statement is used to explicitly generate an exception in C++?
TRE4 C and C++ Quiz practice set 2
64.
Which operator is used in C++ to dynamically allocate memory for a single object?
TRE4 C and C++ Quiz practice set 3
65.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
66.
What is the index of the first element in a C++ array?
TRE4 C and C++ Quiz practice set 3
67.
Which feature of C++ allows multiple functions to have the same name but different parameter lists?
TRE4 C and C++ Quiz practice set 2
68.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
69.
Which of the following is the correct syntax for declaring a pure virtual function in C++?
TRE4 C and C++ Quiz practice set 2
70.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
71.
What is constructor overloading in C++?
TRE4 C and C++ Quiz practice set 2
72.
Which C++ file mode is used to append data at the end of a file?
TRE4 C and C++ Quiz practice set 3
73.
Which access specifier can be used to make a member of a C++ structure private?
TRE4 C and C++ Quiz practice set 2
74.
Which operator is used to combine two or more C++ file opening modes?
TRE4 C and C++ Quiz practice set 3
75.
What was the original name of the C++ language during its early development?
TRE4 C and C++ Quiz practice set 2
76.
Which declaration defines a function that accepts a pointer to an integer and returns a pointer to a character?
TRE4 C and C++ Quiz practice set 3
77.
Which operator is used with cin to extract input from the standard input stream in C++?
TRE4 C and C++ Quiz practice set 2
78.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
79.
At which index does the first element of a C++ array normally begin?
TRE4 C and C++ Quiz practice set 2
80.
What is the default inheritance access mode for a class in C++?
TRE4 C and C++ Quiz practice set 3
81.
Which of the following is a valid declaration of an integer array in C++?
TRE4 C and C++ Quiz practice set 2
82.
What will be the output of the following PHP code?
TRE4 C and C++ Quiz practice set 3
83.
Which C++ type trait is used to determine the size of a particular array dimension?
TRE4 C and C++ Quiz practice set 2
84.
Which keyword is used to define a class in C++?
TRE4 C and C++ Quiz practice set 3
85.
A variable declared inside a function is generally known as what?
TRE4 C and C++ Quiz practice set 2
86.
Which is the correct syntax for declaring a pure virtual function in C++?
TRE4 C and C++ Quiz practice set 3
87.
Which C++ type trait is used to check whether a type is an integral type?
TRE4 C and C++ Quiz practice set 2
88.
When does static type checking primarily occur in C++?
TRE4 C and C++ Quiz practice set 3
89.
Which C library function is used to allocate memory for a specified number of elements and initialize the allocated memory to zero?
TRE4 C and C++ Quiz practice set 2
90.
Which OOP concept allows a derived class to acquire accessible members of a base class?
TRE4 C and C++ Quiz practice set 3
91.
Which statement correctly describes an unnamed class in C++?
TRE4 C and C++ Quiz practice set 2
92.
Which of the following is equivalent to a[3] in C?
TRE4 C and C++ Quiz practice set 1
93.
Assume that an integer occupies 4 bytes. What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
94.
What is the full form of FORTRAN?
TRE4 C and C++ Quiz practice set 3
95.
Which of the following is a major difference between client-side and server-side scripting?
TRE4 C and C++ Quiz practice set 1
96.
Which feature of C++ allows a program to create objects from a user-defined data type?
TRE4 C and C++ Quiz practice set 2
97.
Which language is primarily used to style the appearance of web pages?
TRE4 C and C++ Quiz practice set 3
98.
Which keyword is used with a base class in C++ to implement virtual inheritance?
TRE4 C and C++ Quiz practice set 2
99.
Which translator converts assembly language into machine code?
TRE4 C and C++ Quiz practice set 3
100.
Which operator should normally be used to release memory allocated using new in C++?
TRE4 C and C++ Quiz practice set 2
101.
Which of the following is a valid variable name in C?
TRE4 C and C++ Quiz practice set 3
102.
What is the main purpose of RAII in modern C++?
TRE4 C and C++ Quiz practice set 2
103.
What is the likely result of compiling the following C++ code: int x = 10 cout << x;
TRE4 C and C++ Quiz practice set 3
104.
Which of the following is a valid identifier in C?
TRE4 C and C++ Quiz practice set 2
105.
Which shortcut key is used to run a program in classic Turbo C++?
TRE4 C and C++ Quiz practice set 3
106.
What is the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
107.
Which preprocessor directive is used to include a header file in C++?
TRE4 C and C++ Quiz practice set 3
108.
Which block is used to handle an exception in C++?
TRE4 C and C++ Quiz practice set 2
109.
Which operator is used to release memory allocated for a single object using new in C++?
TRE4 C and C++ Quiz practice set 3
110.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
111.
Which statement correctly initializes an integer array with three elements in C++?
TRE4 C and C++ Quiz practice set 3
112.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
113.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
114.
What happens if an attempt is made to create an object of an abstract class in C++?
TRE4 C and C++ Quiz practice set 2
115.
What happens when the following C++ code is compiled?
TRE4 C and C++ Quiz practice set 3
116.
Which feature of a C++ constructor is used to initialize data members before the constructor body executes?
TRE4 C and C++ Quiz practice set 2
117.
Which C++ file mode is used to open a file for reading?
TRE4 C and C++ Quiz practice set 3
118.
Which of the following can be declared inside a C++ structure?
TRE4 C and C++ Quiz practice set 2
119.
Which access is requested by the following C++ statement?
TRE4 C and C++ Quiz practice set 3
120.
At which organization was C++ originally developed by Bjarne Stroustrup?
TRE4 C and C++ Quiz practice set 2
121.
Which declaration represents a function that accepts a pointer to a pointer to int and returns an int?
TRE4 C and C++ Quiz practice set 3
122.
Which operator is commonly used with cout to display output in C++?
TRE4 C and C++ Quiz practice set 2
123.
Which statement correctly describes the base case in a recursive factorial function?
TRE4 C and C++ Quiz practice set 3
124.
What is the last valid index of an array declared as int a[10] in C++?
TRE4 C and C++ Quiz practice set 2
125.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
126.
Which of the following can be declared in C++?
TRE4 C and C++ Quiz practice set 2
127.
Which PHP function returns the number of elements in an array?
TRE4 C and C++ Quiz practice set 3
128.
Which C++ type trait checks whether a given type is an array type?
TRE4 C and C++ Quiz practice set 2
129.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
130.
What happens if a local variable and a global variable have the same name in C++?
TRE4 C and C++ Quiz practice set 2
131.
Can an object of an abstract class be created directly in C++?
TRE4 C and C++ Quiz practice set 3
132.
Which type trait can be used to determine whether a C++ type is a floating-point type?
TRE4 C and C++ Quiz practice set 2
133.
What is the purpose of a const member function in C++?
TRE4 C and C++ Quiz practice set 3
134.
Which function is used to change the size of a previously allocated memory block in C?
TRE4 C and C++ Quiz practice set 2
135.
Which OOP concept bundles data and the functions that operate on that data into a single unit?
TRE4 C and C++ Quiz practice set 3
136.
What is the main limitation of an unnamed class regarding constructors?
TRE4 C and C++ Quiz practice set 2
137.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
138.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
139.
Which programming language was specifically designed for business data processing?
TRE4 C and C++ Quiz practice set 3
140.
Which of the following is a common use of server-side scripting?
TRE4 C and C++ Quiz practice set 1
141.
Which OOP concept in C++ combines data and the functions that operate on that data into a single unit?
TRE4 C and C++ Quiz practice set 2
142.
Which programming language is commonly used to add interactivity to web pages in a browser?
TRE4 C and C++ Quiz practice set 3
143.
In C++, which type of function is mainly used to achieve run-time polymorphism?
TRE4 C and C++ Quiz practice set 2
144.
Which statement best describes an interpreter?
TRE4 C and C++ Quiz practice set 3
145.
Which operator should be used to release an array allocated using new[] in C++?
TRE4 C and C++ Quiz practice set 2
146.
Which of the following is a reserved keyword in C?
TRE4 C and C++ Quiz practice set 3
147.
Which special member function is automatically called when a C++ object goes out of scope?
TRE4 C and C++ Quiz practice set 2
148.
What does a single semicolon represent in C++?
TRE4 C and C++ Quiz practice set 3
149.
Which statement about keywords in C and C++ is correct?
TRE4 C and C++ Quiz practice set 2
150.
Which shortcut key displays the user screen in classic Turbo C++?
TRE4 C and C++ Quiz practice set 3
151.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
152.
Which standard C++ header file is commonly used for input and output with cin and cout?
TRE4 C and C++ Quiz practice set 3
153.
What happens when an exception is thrown in C++ and a matching catch block is found?
TRE4 C and C++ Quiz practice set 2
154.
Which operator should be used to release a dynamically allocated array in C++?
TRE4 C and C++ Quiz practice set 3
155.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
156.
What is the output of the following C++ code? int a[4] = {2, 4, 6, 8}; cout << a[2];
TRE4 C and C++ Quiz practice set 3
157.
Which C++ feature allows a function to work with different data types without writing separate functions for each type?
TRE4 C and C++ Quiz practice set 2
158.
What will be the output of the following C++ code using std::string?
TRE4 C and C++ Quiz practice set 3
159.
What must a derived class generally do to become a concrete class when inheriting from an abstract class?
TRE4 C and C++ Quiz practice set 2
160.
What is the default inheritance access mode for a class in C++ when no access specifier is written?
TRE4 C and C++ Quiz practice set 3
161.
Why must a const data member generally be initialized using a constructor initializer list in C++?
TRE4 C and C++ Quiz practice set 2
162.
Which C++ file mode is used to open a file in binary mode?
TRE4 C and C++ Quiz practice set 3
163.
What is the default inheritance access specifier when a C++ class is derived from a struct?
TRE4 C and C++ Quiz practice set 2
164.
What happens when an existing file is opened using the following statement?
TRE4 C and C++ Quiz practice set 3
165.
Which programming language was the main base for the early development of C++?
TRE4 C and C++ Quiz practice set 2
166.
What is the type of p in the following C code?
TRE4 C and C++ Quiz practice set 3
167.
Which C++ stream function can be used to extract and discard characters from the input stream?
TRE4 C and C++ Quiz practice set 2
168.
What is the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
169.
How many elements can be stored in an array declared as int marks[25]?
TRE4 C and C++ Quiz practice set 2
170.
Which statement about protected members in C++ inheritance is correct?
TRE4 C and C++ Quiz practice set 3
171.
Which statement correctly describes int *p[5] in C++?
TRE4 C and C++ Quiz practice set 2
172.
What will be the output of the following PHP code?
TRE4 C and C++ Quiz practice set 3
173.
What is the value of std::rank<int[2][3][4]>::value in C++?
TRE4 C and C++ Quiz practice set 2
174.
What is the default access specifier for members of a C++ class?
TRE4 C and C++ Quiz practice set 3
175.
Where is a global variable normally declared in a C++ program?
TRE4 C and C++ Quiz practice set 2
176.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
177.
Which C++ type trait checks whether a specified type is a pointer type?
TRE4 C and C++ Quiz practice set 2
178.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
179.
Which function is used to release dynamically allocated memory obtained using malloc(), calloc() or realloc()?
TRE4 C and C++ Quiz practice set 2
180.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
181.
Which of the following can be declared inside an unnamed class in C++?
TRE4 C and C++ Quiz practice set 2
182.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
183.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
184.
What is the full form of BASIC?
TRE4 C and C++ Quiz practice set 3
185.
In a typical web application, where is PHP code executed?
TRE4 C and C++ Quiz practice set 1
186.
Which OOP feature allows a new C++ class to acquire properties and behaviour of an existing class?
TRE4 C and C++ Quiz practice set 2
187.
What is the full form of URL?
TRE4 C and C++ Quiz practice set 3
188.
What is the main purpose of a virtual destructor in C++?
TRE4 C and C++ Quiz practice set 2
189.
What is the primary function of a linker?
TRE4 C and C++ Quiz practice set 3
190.
What is a memory leak in a C++ program?
TRE4 C and C++ Quiz practice set 2
191.
Are variable names case-sensitive in C?
TRE4 C and C++ Quiz practice set 3
192.
What is the result of allocating memory using new without storing the returned address anywhere?
TRE4 C and C++ Quiz practice set 2
193.
Which symbol normally terminates a simple statement in C++?
TRE4 C and C++ Quiz practice set 3
194.
Which of the following is a keyword in C++ but not a keyword in C?
TRE4 C and C++ Quiz practice set 2
195.
What is the primary function of a C++ compiler?
TRE4 C and C++ Quiz practice set 3
196.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
197.
Which syntax is commonly used to include a user-defined header file named myheader.h?
TRE4 C and C++ Quiz practice set 3
198.
Which of the following can be thrown as an exception in C++?
TRE4 C and C++ Quiz practice set 2
199.
What can happen if memory allocated using new is never released when it is no longer needed?
TRE4 C and C++ Quiz practice set 3
200.
Which statement is correct about a const reference in C++?
TRE4 C and C++ Quiz practice set 2
201.
What happens to the remaining elements when an integer array is partially initialized using a brace-enclosed initializer?
TRE4 C and C++ Quiz practice set 3
202.
What is a function called when it calls itself directly or indirectly?
TRE4 C and C++ Quiz practice set 2
203.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
204.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
205.
Which statement about constructors in C++ structures and classes is correct?
TRE4 C and C++ Quiz practice set 3
206.
What is the main purpose of the explicit keyword with a C++ constructor?
TRE4 C and C++ Quiz practice set 2
207.
What generally happens when an existing file is opened using ofstream with the default output mode?
TRE4 C and C++ Quiz practice set 3
208.
What is the default inheritance mode when a C++ struct derives from another type?
TRE4 C and C++ Quiz practice set 2
209.
Which file opening mode ensures that output is written at the end of a file?
TRE4 C and C++ Quiz practice set 3
210.
Which organization is primarily responsible for international standardization of the C++ programming language?
TRE4 C and C++ Quiz practice set 2
211.
What value is printed by the following C program?
TRE4 C and C++ Quiz practice set 3
212.
Which C++ function is commonly used to read an entire line of text, including spaces?
TRE4 C and C++ Quiz practice set 2
213.
What is the likely result of calling the following recursive function with n equal to 5?
TRE4 C and C++ Quiz practice set 3
214.
What is the value of the remaining elements when a partially initialized integer array is declared as int a[5] = {10, 20};?
TRE4 C and C++ Quiz practice set 2
215.
What type of inheritance is demonstrated by the following C++ code?
TRE4 C and C++ Quiz practice set 3
216.
If int a[10] is declared and an int occupies 4 bytes, what is the total size of array a?
TRE4 C and C++ Quiz practice set 2
217.
What will the following PHP code print?
TRE4 C and C++ Quiz practice set 3
218.
Which header file provides std::rank and std::extent in C++?
TRE4 C and C++ Quiz practice set 2
219.
What will be the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
220.
What is the scope of a variable declared inside an if block in C++?
TRE4 C and C++ Quiz practice set 2
221.
What happens if a derived class does not override an inherited pure virtual function?
TRE4 C and C++ Quiz practice set 3
222.
What does std::is_const<const int>::value return?
TRE4 C and C++ Quiz practice set 2
223.
Which C++ feature enables a function call to be resolved at runtime based on the actual object type?
TRE4 C and C++ Quiz practice set 3
224.
Which statement correctly describes calloc() and malloc()?
TRE4 C and C++ Quiz practice set 2
225.
Which access specifier makes a class member accessible only within the class and its friends?
TRE4 C and C++ Quiz practice set 3
226.
What is a local class in C++?
TRE4 C and C++ Quiz practice set 2
227.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
228.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
229.
Which of the following is a first-generation programming language?
TRE4 C and C++ Quiz practice set 3
230.
Which of the following technologies can be used for server-side web application development?
TRE4 C and C++ Quiz practice set 1
231.
Which OOP concept allows the same function name to perform different operations in different situations?
TRE4 C and C++ Quiz practice set 2
232.
What is the full form of HTTP?
TRE4 C and C++ Quiz practice set 3
233.
Which of the following can be overridden in a derived C++ class?
TRE4 C and C++ Quiz practice set 2
234.
Which system program loads an executable into memory for execution?
TRE4 C and C++ Quiz practice set 3
235.
What is a dangling pointer in C++?
TRE4 C and C++ Quiz practice set 2
236.
Which character can be used at the beginning of a variable name in C?
TRE4 C and C++ Quiz practice set 3
237.
Which smart pointer is designed for non-owning observation of an object managed by shared_ptr?
TRE4 C and C++ Quiz practice set 2
238.
Which is the correct declaration of an integer variable in C++?
TRE4 C and C++ Quiz practice set 3
239.
What is the output of the following C program? int main() { int x = 10; printf("%d", x); }
TRE4 C and C++ Quiz practice set 2
240.
What happens when a C++ program contains a syntax error?
TRE4 C and C++ Quiz practice set 3
241.
Which file extension is commonly used for a C++ source file?
TRE4 C and C++ Quiz practice set 3
242.
Which catch block can be used to catch an exception of any type in C++?
TRE4 C and C++ Quiz practice set 2
243.
What is a dangling pointer in C++?
TRE4 C and C++ Quiz practice set 3
244.
What happens when a null pointer is dereferenced in C++?
TRE4 C and C++ Quiz practice set 2
245.
Which expression accesses the third element of an array named arr in C++?
TRE4 C and C++ Quiz practice set 3
246.
Which C++ feature provides a concise way to define an unnamed function object?
TRE4 C and C++ Quiz practice set 2
247.
What will be the output of the following C++ code using a character pointer?
TRE4 C and C++ Quiz practice set 3
248.
Which statement about a pure virtual function in C++ is correct?
TRE4 C and C++ Quiz practice set 2
249.
Which statement correctly describes member functions in C++ structures and classes?
TRE4 C and C++ Quiz practice set 3
250.
Which of the following statements about a C++ constructor is correct?
TRE4 C and C++ Quiz practice set 2
251.
Which statement correctly describes ios::ate and ios::app in C++?
TRE4 C and C++ Quiz practice set 3
252.
Which statement about using a struct name in C++ is correct?
TRE4 C and C++ Quiz practice set 2
253.
What is the difference between ios::ate and ios::app?
TRE4 C and C++ Quiz practice set 3
254.
Which of the following was the first ISO standardized version of C++?
TRE4 C and C++ Quiz practice set 2
255.
Which declaration correctly defines a function that accepts a pointer to float and returns a pointer to pointer to char?
TRE4 C and C++ Quiz practice set 3
256.
Which C++ input stream function examines the next character without extracting it from the stream?
TRE4 C and C++ Quiz practice set 2
257.
What will the following C++ code print?
TRE4 C and C++ Quiz practice set 3
258.
Which loop is most commonly used to traverse every element of a fixed-size C++ array using its index?
TRE4 C and C++ Quiz practice set 2
259.
Which declaration correctly demonstrates multiple inheritance in C++?
TRE4 C and C++ Quiz practice set 3
260.
When a built-in array is passed to a function in the usual way, what is generally passed to the function?
TRE4 C and C++ Quiz practice set 2
261.
What is the output of this PHP code?
TRE4 C and C++ Quiz practice set 3
262.
What does std::extent<int[5]>::value return in C++?
TRE4 C and C++ Quiz practice set 2
263.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
264.
Which operator can be used to access a global variable when it is hidden by a local variable with the same name?
TRE4 C and C++ Quiz practice set 2
265.
Which statement about constructors in an abstract C++ class is correct?
TRE4 C and C++ Quiz practice set 3
266.
Which C++ type trait is used to determine whether a type is a reference type?
TRE4 C and C++ Quiz practice set 2
267.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
268.
What does malloc() return when the requested memory allocation cannot be satisfied?
TRE4 C and C++ Quiz practice set 2
269.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
270.
Which statement about a nested class in C++ is correct?
TRE4 C and C++ Quiz practice set 2
271.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
272.
Which of the following statements about the sizeof operator in C is correct?
TRE4 C and C++ Quiz practice set 1
273.
Which type of language uses mnemonic instructions such as MOV, ADD and SUB?
TRE4 C and C++ Quiz practice set 3
274.
Which of the following is NOT a fundamental principle of object-oriented programming in C++?
TRE4 C and C++ Quiz practice set 2
275.
Which of the following is a web browser?
TRE4 C and C++ Quiz practice set 3
276.
What happens when a pure virtual function is declared in a C++ class?
TRE4 C and C++ Quiz practice set 2
277.
What is source code?
TRE4 C and C++ Quiz practice set 3
278.
What is the purpose of setting a pointer to nullptr after deleting its dynamically allocated object?
TRE4 C and C++ Quiz practice set 2
279.
Which of the following is not a valid variable name in C?
TRE4 C and C++ Quiz practice set 3
280.
What can happen if a program accesses memory through a pointer after the pointed object has been destroyed?
TRE4 C and C++ Quiz practice set 2
281.
Which software detects and reports many syntax errors in C++ source code?
TRE4 C and C++ Quiz practice set 3
282.
Which format specifier is normally used with printf() to display an integer value of type int?
TRE4 C and C++ Quiz practice set 2
283.
What is the main purpose of debugging a C++ program?
TRE4 C and C++ Quiz practice set 3
284.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
285.
What is the main purpose of a header guard in C++?
TRE4 C and C++ Quiz practice set 3
286.
What is the purpose of a nested try block in C++?
TRE4 C and C++ Quiz practice set 2
287.
What happens if a program dereferences a null pointer in C++?
TRE4 C and C++ Quiz practice set 3
288.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
289.
Which of the following is a valid declaration of a character array in C++?
TRE4 C and C++ Quiz practice set 3
290.
Which of the following can store the address of a function in C++?
TRE4 C and C++ Quiz practice set 2
291.
What will be the output of the following C++ code using strcat()?
TRE4 C and C++ Quiz practice set 3
292.
Can a pointer or reference to an abstract class be declared in C++?
TRE4 C and C++ Quiz practice set 2
293.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
294.
What is the purpose of a delegating constructor introduced in modern C++?
TRE4 C and C++ Quiz practice set 2
295.
Which combination opens an existing file for both reading and writing without requesting truncation?
TRE4 C and C++ Quiz practice set 3
296.
Which operator is normally used to access a public data member of a structure object in C++?
TRE4 C and C++ Quiz practice set 2
297.
What is the likely result of this code if data.txt does not exist?
TRE4 C and C++ Quiz practice set 3
298.
Which C++ standard introduced major modern language features such as lambda expressions and auto type deduction?
TRE4 C and C++ Quiz practice set 2
299.
Which declaration represents a function accepting a pointer to a function that takes an int and returns an int?
TRE4 C and C++ Quiz practice set 3
300.
Which C++ output stream function is used to write a single character to the output stream?
TRE4 C and C++ Quiz practice set 2
301.
What is the output of this recursive C++ function?
TRE4 C and C++ Quiz practice set 3
302.
Which declaration correctly creates a two-dimensional integer array with 3 rows and 4 columns in C++?
TRE4 C and C++ Quiz practice set 2
303.
What happens when a derived class directly accesses a private member of its base class?
TRE4 C and C++ Quiz practice set 3
304.
In most expressions, what does the name of a built-in C++ array represent or convert to?
TRE4 C and C++ Quiz practice set 2
305.
What will be the output of the following PHP code?
TRE4 C and C++ Quiz practice set 3
306.
Which C++ type trait can be used to remove the outermost array dimension from an array type?
TRE4 C and C++ Quiz practice set 2
307.
Which statement about constructors in C++ is correct?
TRE4 C and C++ Quiz practice set 3
308.
What is special about the lifetime of a static local variable in C++?
TRE4 C and C++ Quiz practice set 2
309.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
310.
Which type trait checks whether a given type is a class type in C++?
TRE4 C and C++ Quiz practice set 2
311.
Which C++ operator is commonly used for runtime type checking and safe downcasting in a polymorphic class hierarchy?
TRE4 C and C++ Quiz practice set 3
312.
Which function is commonly used to fill a block of memory with a specified byte value?
TRE4 C and C++ Quiz practice set 2
313.
Which feature of OOP allows the same interface to represent different underlying implementations?
TRE4 C and C++ Quiz practice set 3
314.
What is the purpose of a class declaration in C++?
TRE4 C and C++ Quiz practice set 2
315.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
316.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
317.
Which translator typically translates an entire source program into machine code or another target form before execution?
TRE4 C and C++ Quiz practice set 3
318.
Which approach generally starts by designing smaller components and then combines them to form a complete system?
TRE4 C and C++ Quiz practice set 2
319.
What is the primary function of a web server?
TRE4 C and C++ Quiz practice set 3
320.
Which statement about multiple inheritance in C++ is correct?
TRE4 C and C++ Quiz practice set 2
321.
Which statement about object code is correct?
TRE4 C and C++ Quiz practice set 3
322.
What happens when new cannot allocate the requested memory in its normal form?
TRE4 C and C++ Quiz practice set 2
323.
Which keyword is commonly used to declare a read-only variable in C++?
TRE4 C and C++ Quiz practice set 3
324.
Which C++ feature automatically manages dynamically allocated objects and reduces the need for explicit delete statements?
TRE4 C and C++ Quiz practice set 2
325.
Which symbols are used to enclose a block of statements in C++?
TRE4 C and C++ Quiz practice set 3
326.
Which of the following statements about identifiers in C and C++ is correct?
TRE4 C and C++ Quiz practice set 2
327.
What is the full form of IDE in software development?
TRE4 C and C++ Quiz practice set 3
328.
What is the output of the following C++ expression?
TRE4 C and C++ Quiz practice set 2
329.
Which of the following is a valid C++ preprocessor directive for defining a macro?
TRE4 C and C++ Quiz practice set 3
330.
Which statement about the finally block in standard C++ exception handling is correct?
TRE4 C and C++ Quiz practice set 2
331.
Which statement correctly allocates an array of 10 integers dynamically in C++?
TRE4 C and C++ Quiz practice set 3
332.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
333.
What is the last valid index of an array declared as int nums[8]; in C++?
TRE4 C and C++ Quiz practice set 3
334.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
335.
What will be the output of the following C++ code using substr()?
TRE4 C and C++ Quiz practice set 3
336.
In C++, a class containing only pure virtual functions is commonly used to represent which concept?
TRE4 C and C++ Quiz practice set 2
337.
Which access specifier controls access so that a member can be used within its class and its derived classes, but not directly from unrelated external code?
TRE4 C and C++ Quiz practice set 3
338.
Which type of constructor is primarily associated with transferring resources from a temporary or expiring object in modern C++?
TRE4 C and C++ Quiz practice set 2
339.
What does the following C++ program do to an existing file named data.txt?
TRE4 C and C++ Quiz practice set 3
340.
Which operator is used to access a member through a pointer to a C++ structure object?
TRE4 C and C++ Quiz practice set 2
341.
Which statement opens a file for binary output?
TRE4 C and C++ Quiz practice set 3
342.
Which C++ standard introduced the if constexpr feature?
TRE4 C and C++ Quiz practice set 2
343.
What is the output of this C program?
TRE4 C and C++ Quiz practice set 3
344.
Which function can be used to check whether the end-of-file condition has been reached on a C++ stream?
TRE4 C and C++ Quiz practice set 2
345.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
346.
Which declaration creates a character array capable of storing the string "CAT" including its null character?
TRE4 C and C++ Quiz practice set 2
347.
What is the purpose of virtual inheritance in C++?
TRE4 C and C++ Quiz practice set 3
348.
Which expression dynamically allocates an array of 10 integers in C++?
TRE4 C and C++ Quiz practice set 2
349.
What will be the output of this PHP code?
TRE4 C and C++ Quiz practice set 3
350.
Which C++ type trait removes all array dimensions from an array type?
TRE4 C and C++ Quiz practice set 2
351.
What will be the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
352.
Which statement about a function parameter in C++ is correct?
TRE4 C and C++ Quiz practice set 2
353.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
354.
What is the purpose of std::is_same in C++?
TRE4 C and C++ Quiz practice set 2
355.
What happens when a const object attempts to call a non-const member function in C++?
TRE4 C and C++ Quiz practice set 3
356.
Which function is generally used to copy a specified number of bytes from one memory area to another?
TRE4 C and C++ Quiz practice set 2
357.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
358.
Which keyword is used to define a class in C++?
TRE4 C and C++ Quiz practice set 2
359.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
360.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
361.
Which language-processing approach generally executes program instructions through interpretation rather than requiring a separate compiled executable?
TRE4 C and C++ Quiz practice set 3
362.
Which of the following is used to hide the internal implementation details of an object in C++?
TRE4 C and C++ Quiz practice set 2
363.
In web communication, which component typically sends an HTTP request to a web server?
TRE4 C and C++ Quiz practice set 3
364.
In C++, what is the effect of declaring a member function as final?
TRE4 C and C++ Quiz practice set 2
365.
Which type of error is commonly detected during compilation?
TRE4 C and C++ Quiz practice set 3
366.
Which C++ smart pointer provides exclusive ownership of a dynamically allocated object?
TRE4 C and C++ Quiz practice set 2
367.
Which of the following is a valid variable name in Python?
TRE4 C and C++ Quiz practice set 3
368.
What is the main purpose of a copy constructor in C++?
TRE4 C and C++ Quiz practice set 2
369.
Which is the correct syntax for a basic if statement in C++?
TRE4 C and C++ Quiz practice set 3
370.
Which statement is correct about the case sensitivity of C and C++?
TRE4 C and C++ Quiz practice set 2
371.
Which of the following is commonly part of building a C++ program?
TRE4 C and C++ Quiz practice set 3
372.
What will be the value of x after executing the following C++ code?
TRE4 C and C++ Quiz practice set 2
373.
Which of the following is a common declaration found in a C++ header file?
TRE4 C and C++ Quiz practice set 3
374.
What happens if no matching catch handler is found for a thrown exception?
TRE4 C and C++ Quiz practice set 2
375.
What is the result of deleting the same dynamically allocated pointer twice?
TRE4 C and C++ Quiz practice set 3
376.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
377.
Which statement correctly describes a fixed-size built-in array in C++?
TRE4 C and C++ Quiz practice set 3
378.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
379.
What will be the output of the following C++ code using find()?
TRE4 C and C++ Quiz practice set 3
380.
What is the purpose of the override specifier in C++?
TRE4 C and C++ Quiz practice set 2
381.
What will be the output of the following C++ code using default inheritance?
TRE4 C and C++ Quiz practice set 3
382.
What is the effect of declaring a C++ class constructor as private?
TRE4 C and C++ Quiz practice set 2
383.
What happens when an input file stream attempts to open a nonexistent file using ios::in?
TRE4 C and C++ Quiz practice set 3
384.
Which statement is correct regarding the following C++ declarations?
TRE4 C and C++ Quiz practice set 2
385.
What does the following C++ code do?
TRE4 C and C++ Quiz practice set 3
386.
Which C++ standard introduced concepts and the ranges library as major modern C++ features?
TRE4 C and C++ Quiz practice set 2
387.
Which statement about a function returning a pointer is correct in C?
TRE4 C and C++ Quiz practice set 3
388.
Which C++ stream manipulator forces the output buffer to be flushed?
TRE4 C and C++ Quiz practice set 2
389.
Which problem can occur when recursion has no reachable base case?
TRE4 C and C++ Quiz practice set 3
390.
What can happen when a C++ program accesses an array element outside its valid bounds?
TRE4 C and C++ Quiz practice set 2
391.
What is the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
392.
Which operator should be used to release memory allocated using new[] for a C++ array?
TRE4 C and C++ Quiz practice set 2
393.
Which PHP function checks whether a specified value exists in an array?
TRE4 C and C++ Quiz practice set 3
394.
What does std::rank<int>::value return in C++?
TRE4 C and C++ Quiz practice set 2
395.
In a typical C++ implementation, what is the result of sizeof applied to an empty class?
TRE4 C and C++ Quiz practice set 3
396.
What is the scope of a variable declared in a nested block inside a function?
TRE4 C and C++ Quiz practice set 2
397.
Consider the following C++ code. Which statement is correct?
TRE4 C and C++ Quiz practice set 3
398.
Which C++ type trait checks whether a specified type is void?
TRE4 C and C++ Quiz practice set 2
399.
Which statement correctly describes function overloading and function overriding in C++?
TRE4 C and C++ Quiz practice set 3
400.
Which header is traditionally associated with malloc(), calloc(), realloc() and free() in C++?
TRE4 C and C++ Quiz practice set 2
401.
What happens if a derived class inherits publicly from a base class whose public and protected members are accessible?
TRE4 C and C++ Quiz practice set 3
402.
What does the name of a class primarily represent in C++?
TRE4 C and C++ Quiz practice set 2
403.
What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
404.
Assume that an integer occupies 4 bytes. What will be the output of the following C program?
TRE4 C and C++ Quiz practice set 1
405.
Which of the following is an object-oriented programming language?
TRE4 C and C++ Quiz practice set 3
406.
Which of the following allows the same function name to be used with different parameter lists in C++?
TRE4 C and C++ Quiz practice set 2
407.
Which HTML element is used to create a hyperlink?
TRE4 C and C++ Quiz practice set 3
408.
Which inheritance access mode makes public and protected members of the base class remain public and protected in the derived class?
TRE4 C and C++ Quiz practice set 2
409.
Which of the following are commonly associated with the compilation process?
TRE4 C and C++ Quiz practice set 3
410.
Which C++ smart pointer allows multiple smart pointers to share ownership of the same object?
TRE4 C and C++ Quiz practice set 2
411.
Which statement about identifiers in C is correct?
TRE4 C and C++ Quiz practice set 3
412.
Which situation can lead to a double-delete error in C++?
TRE4 C and C++ Quiz practice set 2
413.
Which of the following can cause a syntax error in C++?
TRE4 C and C++ Quiz practice set 3
414.
Which of the following statements about the main() function in a standard C/C++ program is correct?
TRE4 C and C++ Quiz practice set 2
415.
In classic Turbo C++, which shortcut is used to view the output screen after running a program?
TRE4 C and C++ Quiz practice set 3
416.
What will be the output of the following C++ code?
TRE4 C and C++ Quiz practice set 2
417.
Which statement about C++ header files is correct?
TRE4 C and C++ Quiz practice set 3
418.
Which order is generally used in C++ exception handling?
TRE4 C and C++ Quiz practice set 2
419.
Which statement correctly describes the difference between new and malloc in C++?
TRE4 C and C++ Quiz practice set 3
420.
What will be printed by the following C++ code?
TRE4 C and C++ Quiz practice set 2
421.
What is the output of the following C++ code? int a[3] = {5, 10, 15}; cout << a[0] + a[2];
TRE4 C and C++ Quiz practice set 3
422.
Which return type should normally be used for a C++ function that does not return a value?
TRE4 C and C++ Quiz practice set 2
423.
What will be the output of the following C++ code after appending a character sequence?
TRE4 C and C++ Quiz practice set 3
424.
Which statement about constructors of abstract classes in C++ is correct?
TRE4 C and C++ Quiz practice set 2
425.
What will happen when the following C++ code is compiled?
TRE4 C and C++ Quiz practice set 3
426.
Which statement about the return type of a C++ constructor is correct?
TRE4 C and C++ Quiz practice set 2
427.
Which statement about combining C++ file-opening modes is correct?
TRE4 C and C++ Quiz practice set 3
428.
Which feature is supported by a structure in C++ but is not supported by a traditional structure in C?
TRE4 C and C++ Quiz practice set 2
429.
Which file opening mode combination requests both input and output in binary mode?
TRE4 C and C++ Quiz practice set 3
430.
Which sequence correctly represents the development order of these C++ standards?
TRE4 C and C++ Quiz practice set 2
431.
What does the following declaration mean in C?
TRE4 C and C++ Quiz practice set 3
432.
What happens when the extraction operator cin >> is used to read a string containing spaces?
TRE4 C and C++ Quiz practice set 2
433.
What is the output of the following C++ code?
TRE4 C and C++ Quiz practice set 3
434.
Which C++ feature can be used to conveniently iterate over all elements of an array without explicitly using an array index?
TRE4 C and C++ Quiz practice set 2
435.
What is the output of the following C++ code using virtual functions and inheritance?
TRE4 C and C++ Quiz practice set 3
436.
Which C++ Standard Library container provides a fixed-size array with useful member functions such as size()?
TRE4 C and C++ Quiz practice set 2
437.
What will be the output of the following PHP code?
TRE4 C and C++ Quiz practice set 3
438.
Which statement correctly describes C++ type traits such as std::rank?
TRE4 C and C++ Quiz practice set 2
439.
Which object-oriented programming principle combines data and the functions that operate on that data into a single unit?
TRE4 C and C++ Quiz practice set 3
440.
Which statement correctly distinguishes scope and lifetime of a variable in C++?
TRE4 C and C++ Quiz practice set 2
441.
Which statement about a pure virtual function in C++ is correct?
TRE4 C and C++ Quiz practice set 3
442.
What does std::is_pointer<int>::value return in C++?
TRE4 C and C++ Quiz practice set 2
443.
What is the output of the following C++ program?
TRE4 C and C++ Quiz practice set 3
444.
Which statement about realloc() is correct?
TRE4 C and C++ Quiz practice set 2
445.
Consider the following C++ code. Which statement is correct?
TRE4 C and C++ Quiz practice set 3
446.
Which statement about a class object in C++ is correct?
TRE4 C and C++ Quiz practice set 2
447.
Which of the following statements about arrays and pointers in C is correct?
TRE4 C and C++ Quiz practice set 1
448.
Which of the following statements about sizeof and expressions in C is correct?
TRE4 C and C++ Quiz practice set 1