So when i enter a char or string, it asks the question again but infinitely... but i want it to ask once every time wrong, then again if wrong. Get it... ? :( right now the loop is infinite.
#include <iostream>
using namespace std;
int main() {
float money;
do
{
cout << "How much money do you have? " << endl;
cin >> money;
if (money) {
cout << "You have: " << money << "$" << endl;
} else {
cout << "You have to enter numbers, try again." << endl;
}
} while (!money);
return 0;
}