LogiQuest
Back to Constructors and Destructors
1

What will be the output of the program?

#include <iostream>
using namespace std;
class A {
public:
    A() { cout << "C"; }
    ~A() { cout << "D"; }
};
int main() {
    A a;
    cout << "M";
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.

What will be the output of the… | LogiQuest