Trying to relearn C++ and started with this simple program. Data capture works as expected the first time, but if I trigger the DO loop by answering "no" to the question, it won't let me enter data. I will post the program output below the code.
I tried clearing the variable but that didn't make a difference. I suspect there is an issue with the getline, but it works on the first iteration. I can't see it.
Your main problem is leaving the newline in the input stream when reading 'correct'. Maybe use getline instead so you consume the newline. Alternatively you could do a cin.ignore(999, '\n') after the cin >> correct.
Your program structure is bad, though. You shouldn't use global variables since they teach bad habits. Declare local variables, pass function parameters, accept return values: