#include #include #include int main() { int a,b,c,d; printf(" ----------Quadratic Solver----------\n\n"); printf("Enter the variables, separated by spaces: "); scanf("%d %d %d",&a,&b,&c); d = pow(b,2) - 4 * a * c; if (d < 0) { printf("This formula cannot be solved."); } elseif (d == 0) { float total; total = -b / (2 * a); printf("Solution:\n %d",total); } elseif (d > 0) { float root,total1,total2; root = sqrt(d); total1 = (-b + root) / (2 * a); total2 = (-b - root) / (2 * a); printf("Solutions:\n %d\n %d",total1,total2); } return 0; getch(); }