#include "library.h" double solve_quadratic_1(double A, double B, double C) { // the formula is A*x*x + B*x + C = 0, solve for x return (-B - sqrt(B*B - 4*A*C)) / (2*A); } double solve_quadratic_2(double A, double B, double C) { // the formula is A*x*x + B*x + C = 0, solve for x return (-B + sqrt(B*B - 4*A*C)) / (2*A); } void main() { const double x1 = solve_quadratic_1(1, 6, 1); print("Axx + Bx + C = "); print(1*x1*x1 + 6*x1 + 1); new_line(); const double x2 = solve_quadratic_2(1, 6, 1); print("Axx + Bx + C = "); print(1*x2*x2 + 6*x2 + 1); new_line(); }