Hello.
So I wrote this program:
The problem is that if I do not enter a number, but e.g. the letter L, some strange characters appear, and I would like it to show e.g. This is not a number.
There is one more problem that if I give it 0 to a and 0 to b, it will show me that there are infinitely many solutions and also some other strange characters, and I would like these characters to be absent.


Please place the code in code tags - krzychoocpp
So I wrote this program:
int main()
{
float a;
float b;
float x;
cout << " licze rownanie liniowe, pierwszego stopnia, z jedna niewiadoma.\n";
cout << " ax+b=0\n";
cout << "Podaj a: ";
cin >> a;
cout << "Podaj b: ";
cin >> b;
if (a==0 && b==0) cout << "Nieskonczenie wiele rozwiazan\n";
else if (a==0 && b!=0) cout << "Brak rozwiazan\n";
x=-b/a;
cout << "x = "<<endl;
}
The problem is that if I do not enter a number, but e.g. the letter L, some strange characters appear, and I would like it to show e.g. This is not a number.
There is one more problem that if I give it 0 to a and 0 to b, it will show me that there are infinitely many solutions and also some other strange characters, and I would like these characters to be absent.


Please place the code in code tags - krzychoocpp