Question: 1. (20 points Write a function that raises an integer to a positive integer power. Call the function x to the n taking two integer
1. (20 points Write a function that raises an integer to a positive integer power. Call the function x to the n taking two integer arguments x and n. Have the function return a long int, which represents the results of calculating x. 2. (20 points) An equation of the form is known as a quadratic equation. The values of a, b, and c in the preceding example represent constant values. So represents a quadratic equation where a 4, b 17, and c 15. The values of x that satisfy a particular quadratic equation, known as the roots ofthe equation, can be calculated by substituting the values of a, b, and c into the following two formulas: bt V b2 4ac 2a If the value of b 4ac, called the discriminant, is less than zero, the roots ofthe equation, xi and x2, are imaginary numbers. Write a program to solve a quadratic equation. The program should allow the user to enter the values for a, b, and c. Ifthe discriminant is less than zero, a message should be displayed that the roots are imaginary; otherwise, the program should then proceed to calculate and display the two roots of the equation. (Hint: you may need to include math.h header file like "finclude
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
