write a C program that prompts the user to specify the coeffients of a quadratic equation and then calculates the roots of the quadratic equation. It prints outs the roots of the quadratic equation. 1. The program must an array to store the coefficients of the quadratic equation. 2.The program obtains the coefficients of a quadratic equation from the command line. 3.If the coefficient is zero then specify this in the command line, for example quadratic.exe 1 0 -4. 4.The program must check that the correct number of input arguments are entered and entered and display an error message if the incorrect number of arguments are entered. 5.The program must use a loop to store the coefficients in an array 6.The program must define and call a function called calc_roots with the coefficient array as input arguments. The function return no value . Define local variables 7. The function calc_roots must calculate the root of quadratic equation. 8.Use if statements to check the calculated root values are negative and then display the root as either (x-r) or (x+r, where r is the calculated root. 9.The program structure and use of libraries must be correct
write a C
1. The program must an array to store the coefficients of the quadratic equation.
2.The program obtains the coefficients of a quadratic equation from the command line.
3.If the coefficient is zero then specify this in the command line, for example quadratic.exe 1 0 -4.
4.The program must check that the correct number of input arguments are entered and entered and display an error message if the incorrect number of arguments are entered.
5.The program must use a loop to store the coefficients in an array
6.The program must define and call a function called calc_roots with the coefficient array as input arguments. The function return no value . Define local variables
7. The function calc_roots must calculate the root of quadratic equation.
8.Use if statements to check the calculated root values are negative and then display the root as either (x-r) or (x+r, where r is the calculated root.
9.The program structure and use of libraries must be correct
Step by step
Solved in 4 steps with 2 images