Home Why do I keep getting an infinite loop?
 I keep getting an infinite loop? What do i have to change to fix this? I am a beginner. Please help. I cant figure this out. I tried playing around with all the other loops but keep getting the same error. #include using namespace std; int inputData(); int convertData(); int outputData(); int main () { inputData(); return 0; } int inputData () { int hours, minutes; char am_pm; cout << "Please enter hours: "; // ask user to input hours. cin >> hours; do { if (hours > 23) { cout << "ERROR! Must be less than 23" << endl; } } while (hours > 23); // end of hours loop cout << "Please enter minutes: "; cin >> minutes; do { if (minutes > 59) { cout << "Must be less than 59. Try again!" << endl; } } while (minutes > 59); }