One slightly unrelated suggestion I have for your a==0 error check is to use a do while statement instead of having your program close. It would look like this:
do
{
cout << "Enter a number for a: ";
cin >> a;
if (a==0)
{
cout << "Can't use 0 for a.";
}
} while (a==0);
This makes it so the user doesn’t have to restart the program if they input an invalid number. Just a suggestion.
8
solved Quadratic Equation c++ [closed]