I am asking for user input for investment, I have a while loop condition for if the input is < 0 or cin.fail() and when I run the code and enter 'g' it throws an endless output of the cout statements. What am I doing wrong ?
cin >> investment;
while ((!(investment >= 0)) || cin.fail()) {
cout << "Please enter an amount $0 or more" << endl;
cout << "Initial Investment Amount: $";
cin >> investment;
}