#include <iostream>
#include <windows.h>
usingnamespace std;
class addClass{
public:
int add2 (int x,int z)
{
int ans = x+z;
cin >> x;
cin >> z;
ans = x + z;
return ans;
}
};
int main()
{
addClass addOB;
addOB.add2(0,0);
system ("Pause");
return 0;
}
this is the beginning of a multi functional calculator im trying to make as my first multifunctional program. later on im going to try to add if and else if statements to utilize the different calculator types and see what else i can do to make it work.
right now im having trouble getting the value of "ans". I can input 2 numbers but never get a return value. I've tried all that I know, please help me!