You will write a C file with the main function with three additional functions described below. Your Program will start calling part1, part 2 and part 3 functions in that order. For each part, you will receive the inputs from the user and print the output to the console. Details of the parts are further discussed below. Please pay attention to the output format. Any deviation from the shared format may be penalized regardless of the correct execution.
Part 1. Your function will read three integers from the command prompt as coefficients of a quadratic equation and calculate the roots of the equation. If the roots are Real then Your program will print the equation and the roots to the console in descending order. If roots are complex numbers then the program will inform the user about the complex roots.
Example 1:
Please Enter the first coefficient:1
Please Enter the second coefficient:-3
Please Enter the third coefficient:-4
Output Your equation 1x^2 - 3x - 4 have real roots {4,-1}.
Example 2:
Please Enter the first coefficient:1
Please Enter the second coefficient:0
Please Enter the third coefficient:1
Output Your equation 1x^2 + 0x + 1 does not have any real roots. The function prototype is:
Function prototype is void find_root()
Part 2. Your second function will search for the roots by a numerical method called "Newton's Algorithm". This method is an iterative root-finding algorithm that produces better approximations to the roots of a real-valued function. You can find a very easy-to-understand introduction at Wikipedia. Furthermore, web page at https://planetcalc.com/7748/ can serve u as both a guideline and a validation resource.
In this function, you will again ask for three coefficients and an initial guess from the user and apply Newtons Method 5 times. In each step, you will compare the actual root and the estimated root (from the Newtons method) and print the difference. Unlike the first function, you don't have to worry about complex roots. You can safely assume that users will not provide a function with complex roots.
Example:
Please Enter the first coefficient:1
Please Enter the second coefficient:-3
Please Enter the third coefficient:-4
Please Enter the initial: 10
Output Your equation is 1x^2 - 3x - 4 and iterations are
Part 3. Given two integer you will calculate, divisibility of the first integer by the second one. If it is not, you will find the closest divisible integer. You will ask for the user input in the main function and pass the parameters to the find_multiple method. This function will return to the main function and it will be printed on the command prompt.
Example 1:
Enter the first integer: 76
Enter the second integer: 15
Output Closest number to 76 that is multiple of 15 is 75.
Example 2:
Enter the first integer: 76
Enter the second integer: 13
Output Closest number to 76 that is multiple of 15 is 78.
Example 3:
Enter the first integer: 76
Enter the second integer: 19
Output Closest number to 76 that is multiple of 15 is itself.
Function prototype is int find_multiple_closest(int a, int b)