Hello, I am new here and I've searched around to try and find where I went wrong, but maybe I'm just not seeing it. So I decided to post it here in hopes that someone can point out my error. My program is a simple program. It asks you to add two random numbers together. It will then tell you if it is correct or incorrect. You then have the option to try a new problem or try to answer your previous problem again (I havn't established the correct code for trying the same problem again, because I wanted to test this program out first.) My problem is that after it is answered and calculated to be correct or incorrect, it automatically jumps out of loop and ends the program with "Okay." (Seen at the end of the program). Any advice? (Once again the "Incorrect" option has not been completed, it's simply a test to practice IF/ELSE and DO..WHILE loops).

Code:
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main()
{
    char input[1];
    int x = rand() & 25;
    int y = rand() & 25;
    int a = x+y;
    int answer;
    cout<<"This program is a simple test. You must add 2 random numbers.\n\n";
    do {
        cout<<"The question is: " << x << "+" << y << "= ";
        cin>>answer;
        cout<<"\n\n";
        if (answer == a){
                cout<<"Correct!\n\n";
                cout<<"Would you like to try a new problem? (y/n): ";
                gets(input);
        }
            else if (answer != a) {
                cout<<"Incorrect!\n\n";
                cout<<"Would you like to try again? (y/n): ";
                gets(input);
            }
    } while (strcmp (input, "y") == 0);
    cout<<"Okay.";
    cin.get();
}

Thank you.