What's the problem here? (Im still noob, yes)
I wanted to use some code by guys that helped me on another code so I can see if I learned it but I guess I missed something, instead of again asking for input it just outputs it over again. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { bool quit = false; while(!quit) { float meters; cout << endl << "Enter a value in meters: " << endl << endl; while (meters < 1) { cin >> meters; if (cin.fail() || meters < 1) { cin.clear(); cin.ignore(512, '\n'); meters = 0; cout << endl << "Invalid input, please try again." << endl << endl; } } float feet = meters * 3.2808399; cout << endl << meters << " meters " << "is " << feet << " feet." << endl; int choice; cout << endl << "Do you want to try again? Type 1 to continue or 0 to quit." << endl << endl; cin >> choice; if(choice == 0) { quit = true; } } }