if (whatever condition) correct(); else { incorrect(); cout << "Enter y to restart: "; char c; cin >> c; if (c == 'y') continue; else return 1; }