computerwork
Banned
hello
please explain this
using namespace std;
class Mathematics {
int x, y;
public:
void input() {
cout << "Input two inetegers\n";
cin >> x >> y;
}
void add() {
cout << "Result = " << x + y;
}
};
int main()
{
Mathematics m; // Creating object of class
m.input();
m.add();
return 0;
getchar();
getchar();
}
please explain this
using namespace std;
class Mathematics {
int x, y;
public:
void input() {
cout << "Input two inetegers\n";
cin >> x >> y;
}
void add() {
cout << "Result = " << x + y;
}
};
int main()
{
Mathematics m; // Creating object of class
m.input();
m.add();
return 0;
getchar();
getchar();
}