The question is to determine if the equation a*x+b=0 has 1 solution, and write it, if it has 0 solutions write no solutions and if it has infinite solutions type infinite solutions
#include <iostream>
using namespace std;
int main()
{
float a,b,x;
cin>>a>>b;
x=-b/a;
if(x!=0)
cout<<x<<endl;
else if(a==0)
cout<<"no solution"<<endl;
else
cout<<"infinite solutions"<<endl;
return 0;
}
Its supposed to write "no solutions" but instead it says -inf