The image shows a multiple-choice question (question 49) from a HirePro OA assessment...
Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.
The image shows a multiple-choice question (question 49) from a HirePro OA assessment regarding C++ constructor and destructor behavior.
Question 49:
What is the output of the following C++ code?
#include <iostream>
using namespace std;
class A {
public:
A() { cout << "Constructor called" << endl; }
~A() { cout << "Destructor called" << endl; }
};
int main() {
A a;
delete a;
return 0;
}
Show answer & explanation
Answer: A. A) Constructor called
Verified technical evaluation based on core computer science and mathematical principles.
Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.