I need to ensure that h, d, and t aren't input negative (that part works) and that t is no greater that half the lesser of h and d. If I input a t value larger than h and d, it still computes instead of looping to ask for input again. This is connected to a header file and another cpp file but I'm not concerned with any of that right now.
Well, I don't know why it works, but I changed it on mine and I've tested it about ten times now with completely random values and it's worked just fine.
1 2 3 4 5
do
{
cout << "Enter the cylinder height, diameter, and wall thickness: ";
cin >> h >> d >> t;
}while (h < 0 || d < 0 || t < 0 || (d <= h && t > (0.5 * d)) || (h < d && t > (0.5 * h)));
EDIT: Also tested with rand() about 20 more times with a max value of 999.