This program succeeds, and its runs but, it doesnt to anything. Everytime i run it the "press any key to continue...". Any reasons why this doesnt work?
int main()
{
cout << "Enter:" << endl;
cout << "+ for the addition operation" << endl;
cout << "- for the subtraction operation" << endl;
cout << "* for the multiplication operation" << endl;
cout << "/ for the division operation" << endl;
cout << "^ for the exponentiation operation" << endl;
cout << "l for the base-10 logarithm operation" << endl;
cout << "! for the factorial operation and" << endl;
cout << "q to quit." << endl;
switch (character)
{
case '+' : addition();
break;
case '-' : subtraction();
break;
case '*' : multiplication();
break;
case '/' : division();
break;
case '^' : exponentation();
break;
case 'l' : logarithm();
break;
case '!' : factorial();
break;
case 'q' : return 0;
}
}
void addition()
{
int number1;
int number2;
int sum;
You never input character, therefore it does not match any of the switch cases. Also, the return 0; should
really be outside of the switch statement, but that's another story.