/************************************************************* C151 Multi-user operating systems. Dana Vrajitoru January 20, 2004. This program computs the solution for the equation ax+b = 0. It contains some compilling errors and is baadly indented for the purposes of the homework. This coment also contains spelling errors for the purpos of the homeworl. **************************************************************/ #include using namespace std; int main() { float a, b, x; // Input a. COUT << "Enter a number a:" << endl; cin >> a; // Input b COUT << "Enter a number b:" << endl; cin >> b; // Compute x if (a == 0) if (b == 0) COUT << "The equation has an infinity of solutions." << endl; else COUT << "The equation has no solution." << endl; else{ x = -b/a; COUT << "The solution for the equation ax+b = 0 is " << x << endl; } return 0; } /********************* Program output ************************* Enter a number a: 2 Enter a number b: 4 The solution for the equation ax+b = 0 is -2 ***************************************************************/