Please find the output of the following program. In order to be able to execute the code in a compiler, syntax errors must be fixed first. Please write outputs to the reserved box.
#include <iostream>
using namespace std;
class num {
private:
int cn, fn;
protected:
int set(int c = 2) {
fn = c;
cn++;
cout << fn;
return (fn++);
}
int fnd(int k = 1) {
cout << k << endl;
return (3 + k * 2);
}
int get() {
return (cn);
}
public:
num(int z = 6) : cn(fnd(2)) {
fn = set(z);
}
int inc() {
return cn += 3;
}
int inc(int x) {
return fnd();
}
void print() {
cout << fn << endl << cn << endl;
}
};
class mon : public num {
public:
mon() {
cout << get();
}
void print() {
cout << fnd() << endl;
set(1);
}
};
int suf() {
mon a;
cout << a.inc() << endl;
}
int main() {
num a(3);
cout << a.inc(4) << endl;
suf();
return 0;
}