Why wont the code ask the user again when I try running it if the answer is not y or n?

```
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
    char answer;
    cout << "Do you like cheese?" << endl;
    cin >> answer;

    if ( answer != 'y' && answer != 'n' ) {
        cout << endl << "Wrong answer, Try again: ";
        cin >> answer;
    }
    return 0;
}

```

I understand it's not a loop but my other code seems to work fine. If the scored is less than 0, it will keep asking for a number. Why wont this code work then?

```
cout << "Enter the number of goals that were scored: ";
cin >> scored;

if ( scored < 0 ) {
    cout << "Error: the number of goals must be greater than 0. Try again: ";
    cin >> scored;
}

```