1
Loading subject content…
Loading subject content…
Loading practice questions…
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;
}What will be the output of the program?
#include <iostream>
using namespace std;
class M {
const int id;
public:
M(int i) : id(i) {}
int get() const { return id; }
};
int main() {
M m(77);
cout << m.get() << endl;
return 0;
}