1. when i try the exponent option (5), it always gives me an answer of infinty.
2. I gotta do a while loop to keep it from closing without the user choosing the option to
3. Those "####"'s are supposed to be there. :)
1. it is because resuly pow is calculated after you input 'X' and 'Y' is a garbage memory address and then 'Y' is changed after and the calculation is not done again in the case 5.
you need to move the resultPow = Pow ( x,y) before the cout << ANSWER.... etc
2. on case 0;
add a
1 2 3 4 5
cout<< " are you sure you want to quit?" <<
cin.get();
}
return 0;
}
char play_again = 'y';
do
{
[code here]
cout << "Would you like to play again? (y or n)\n";
cin >> play_again;
if(play again = 'y')
{
continue;
}
else
{
break;
}
}while(play_again = 'y')
I don't see why you'd need the ####'s.
Happy coding.