So I'm creating a program for a C++ class, and I created a while loop to stop invalid inputs. Every time I do test it with an invalid input it goes into an infinite loop. I'm new to coding, so I really don't know how to fix it.
cout << "Enter weight in ounces (Max: 1800)" << endl;
cin >> pkgweight;
while (pkgweight > 0 || pkgweight < 1800)
{
cout << "Weight out of range. Program terminating.\n" << endl;
}
cout << "Enter miles shipping (Max: 3500)" << endl;
cin >> distance;
while (distance > 0 || distance < 3500)
{
cout << "Shipping distance out of range." << endl;
cout << "Program terminating.\n" << endl;
}