You can add an extra condition in your main loop and that could control how you exit from the loop.
e.g.:
bool gameOver = false;
...
while (!gameOver && (NumberofMinesToFind > 0 || NumberOfFlags < MaxFlags || Found == false))
{
...
if (Move == 'M')
{
if (Found == false)
{
cout << "GAME OVER" << endl;
gameOver = true;
}
}
....
}
An alternative is that instead of setting the gameOver flag, don't use it at all, just call break to leave the loop. In this case, you have to find other means to know that the game is over and the loop didn't quit for other reasons.