Can you help me guys? I'm a total beginner. My code worked fine then KEEP LOOPING FOREVER and never goes back to or cmd would crash with "Process terminated with status -1073741676". It should loop once then CIN >> again. It happens when I enter 10 digit numbers in my CIN >>.
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class noteAssign {      //This class return "A" if the random number generated is between 1 and 10
    public:
        int x;
        int noteOut(int x){
            if(x>1 && x<10){
                cout << "ITS A" << endl;
                return x;
            }else{
            cout << "IT'S NOT A" << endl;
            return x;
            }
            }
}gonote;
int main()
{
    cout << "Match the note's Hertz!" << endl;
    cout << "Your answer may range from 1 to 20" << endl;
    cout << "Type 0 to quit" << endl;
    int noteIn;                 //No real purpose YET
    do {
        srand(time(0));             //ADDING MULTIPLE RAMDOMIZER FOR WIDER RANDOM RANGE
        int rand1 = 1+(rand()%20); //randomizer 1
        int rand2 = 1*(rand()%20); //randomizer 2
        int hzout = (rand1 * rand2 + rand1 / rand2)%20; //rand 3
        noteAssign gonote;
        cout << gonote.noteOut(hzout) << endl;      //calls the function and gives the parameter
        cin >> noteIn;          //No real purpose YET
    } while(noteIn != 0);       //program quits when you enter "0"
};
 
    