Breaking out of a loop does not necessarily mean the use of the break statement. The way you wrote the while loop does it for you.
[php]// exit a loop (Dev-C++)
#include
using namespace std;
int main(int argc, char *argv[])
{
char answer;
while((answer != 'Q') && (answer != 'q'))
{
cout << "Do you want to quit displaying triangle?" << endl;
cin >> answer;
// does not need break!
// more code here ...
}
cin.get(); // wait
return 0;
}
[/php]
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417