Question: Create a C-Program that will take the square root of a number using a square-root function that corresponse to the following protoype: double mySqrt(double x);

Create a C-Program that will take the square root of a number using a square-root function that corresponse to the following protoype: double mySqrt(double x); (for x => 0)

Please use the Newton-Raphson equation:

Create a C-Program that will take the square root of a number

using a square-root function that corresponse to the following protoype: double mySqrt(double

Relative error:

x); (for x => 0) Please use the Newton-Raphson equation: Relative error:

-"Find the quare root of" Displays on the screen when ran. User enters a number and hits return, and then the application prints the quare root of the number enter, or an error message if the user enters a negative number.

- The function should check to make sure the number entered by the user is not negative. If the user enters a negative number and that negative number is given to the function mySqrt(x), mySqrt(x) should return -1 as an error code. The main program can check for the error code and decide what message to print to the user if the error code is returned.

- To calculate the relative error, you will need an absolute value function. You can write your own, or use the fabs( ) function from the #include library.

Thank you!

UPDATE:

-"Find the quare root of" Displays on the screen when ran. Userenters a number and hits return, and then the application prints thequare root of the number enter, or an error message if theuser enters a negative number. - The function should check to make

k+1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!