/* Lecture notes from Prof. Barimani's class 1/2 (4AC) - 8 M = C + ------------ 2B Rule #1) B cannot be zero Rule #2) AC cannot be negative */ #include #include using namespace std; void formulaM(double A, double B, double C) { double M; M = C + (sqrt(4 * A * C) - 8 ) / (2 * B); cout<<"M = "<>A>>B>>C; if (B == 0) { cout<<"B cannot be zero\n"; } else { if (A*C < 0) { cout<<"AC cannot be zero\n"; } else { formulaM(A, B, C); } } system("PAUSE"); return 0; }