Question: The program should be in C T The square root x of a real numberr>0 with relative precision e > 0 can be calculated with
The program should be in C
T
The square root x of a real numberr>0 with relative precision e > 0 can be calculated with the following recursive process (Newton's method) , until "n-1 2 rt TL Write a function with the name mysqrt that takes as arguments two real numbers r and e and calculates the square root according to the aforementioned process. Use the function mysqrt in a program where the user is asked to provide a positive real number and the program prints the square root of this number with relative precision 10-6. The program should be continuous until the user enters a negative number. Note:In order to calculate the square root, you will need to use the fabs function that calculates the absolute value of a real number and which is declared in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
