Help Parameters.

Nov 26, 2011 at 9:25pm
#include <iostream>
#include <string>
using namespace std;

int Calculator(int x,int y){
int answera = x + y;
int answerb = x - y;
int answerc = x * y;
int answerd = x / y;
cout << x << " + " << y << " equals..." << answera << endl;
cout << x << " - " << y << " equals..." << answerb << endl;
cout << x << " * " << y << " equals..." << answerc << endl;
cout << x << " / " << y << " equals..." << answerd << endl;
}
int main()
{
Calculator(2000,1000);

system("PAUSE");
return 0;
}

why cant i say cin >> Calculator or cin >> x; or something in order to input into the parameter so the parameter function can output something from a input thx. im new to c++ if this isnt possible what choice should i use cases?
Nov 26, 2011 at 9:31pm
You aren't making any sense. Show what you tried to to do. That way, people will know what you did wrong.
Nov 26, 2011 at 9:55pm
i just wanna be able to input into the paramter instead of only output. or is that impossible?
Nov 26, 2011 at 9:58pm
Is this what you want?
1
2
3
4
int x;
int y;
cin >> x >> y;
Calculator(x, y);

Nov 26, 2011 at 10:07pm
i think that could work lemme try.
Nov 26, 2011 at 10:10pm
perfect. thx
Topic archived. No new replies allowed.