int main() { double x[3]; unsigned n; basis A = {{ 0.875726, 0.055288, -1.597033}, { -1.201369, -1.358298, -1.095408}, { 1.447017, -1.275570, -1.720548}}; n = cubic_roots(1.0 / 4.0, 3.0 / 4.0, -6.0 / 4.0, -8.0 / 4.0, x); print_roots(n, x); n = cubic_roots(2.0, -3.0, -3.0, 2.0, x); print_roots(n, x); n = basis_eigenvals(A, x); print_roots(n, x); n = basis_eigenvals(basis_ident, x); print_roots(n, x); return 0; }
int main() { const int n = 3; double coefficients_equation[n]; double root_equation[n]; printf("Enter values a, b, c\n"); scanf( "%lg%lg%lg" , &coefficients_equation[2], &coefficients_equation[1], &coefficients_equation[0] ); quadratic(coefficients_equation, root_equation); print_roots(coefficients_equation, root_equation); return 0; }