Creating a Loop (PLEASE HELP!)
:( I have been having trouble with a really basic program and it's making me feel bad! I narrowed it down to 1 error but I can't figure out what is wrong...
-------------------------------------------------------------------------------------
bool end = false;
It says there is a syntax error here --> while(!end)
#include <iostream.h>
int main ()
{
char answer;
int m;
int n;
int c;//variables for Pythagorean Theorem
cout << "Please enter a number.\n";
cin >> m;//enter the larger number
cout << "Now enter a number smaller than the first.\n";
cin >> n;//enter the smaller number
if(n >= m)//Check for correct input.
cout << "You entered incorrect input.\n";
if(n >= m)//I couldn't get it to perform 2 actions.
return 0;
c = (m * m) + (n * n); //find the solution
cout << "Your answer is " << c << '\n';
cout << "Would you like to perform another problem? (y, n) ";
cin >> answer;
if(n)
end = true;
return 0;
}