if (digit_only > x value) {cout << "Enter a value less than x value"}; then just point back to digit box. well this a way that i would do it but there are other ways. or u could just write beside the digit box that say "do not enter a number more than x value"