### My calculator doesnt run!

There´s an error in line 70 that i can´t find. I think that everything is alright.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105`` ``````//Calculator by Enrique Junchaya #include using namespace std; double addition(double x, double y) { return x+y; } double substraction(double x, double y) { return x-y; } double multiplication(double x, double y) { return x*y; } double division(double x, double y) { return x/y; } long long factorial(int x) { int n; long long m=1; for ( n=x ; n>0 ; --n ) { m *= n; } return m; } long long raising(int x, int y) { long long m=1; for ( y ; y>0 ; --y ) { m *= x; } return m; } int main() { char o; double a, b; int c, d; label: cout << "What operation do you want to do?" << endl; cout << "Write +, -, *, /, ! or ^." << endl; cin >> o; switch(o) { case '+': cout << "Now write the numbers." <> a; cin >> b; cout << a << "+" << b << " = " << addition(a,b); goto label; case '-': cout << "Now write the numbers." << endl; cin >> a; cin >> b; cout << a << "-" << b < " = " << substraction(a,b) << endl; goto label; case '*': cout << "Now write the numbers." << endl; cin >> a; cin >> b; cout << a << "*" << b << " = " << multiplication(a,b) << endl; goto label; case '/' : cout << "Now write the numbers." << endl; cin >> a; cin >> b; cout << a << "/" << b << " = " << division(a,b) << endl; goto label; case '!': cout << "Now write the entire number." << endl; cin >> c; cout << c << "! = " << factorial(c) << endl; goto label; case '^': cout << "Now write the entire number to be raised. "; cin >> c; cout << "Now write the exponent. "; cin >> d; cout << c << "^" << d << " = " << raising(c,d) << endl; goto label; default: cout << "Unknown Character. Try again." << endl; goto label; } }``````
`cout << a << "-" << b << " = " << substraction(a,b) << endl;`

You forgot one of the right-angle brackets.
Last edited on
LOL How couldn´t I see it .-.!
Topic archived. No new replies allowed.