Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use C program gcc and be sure about your answer. Problem 2 (4 points) iteration The square root of a number a > 0
please use C program gcc and be sure about your answer.
Problem 2 (4 points) iteration The square root of a number a > 0 can be computed using Newton's Zn+1 = 0.5(Zn + a/Zn), where zo is an initial guess Write a C program that takes as input an initial guess ro, o tolerance tol, and number of iterations, n max and iterates the above scheme until convergence or nmax is reached. The iterations converge when n+1-l tol, your program should also output a message with the value of +nl, e.g Enter positive number, initial guess, tolerance, max number of iterations: 100 1 1e-14 5 Max iterations 5 reached, lx-{n+1) -x_al = 3.3e-02 sqrt (100) 1.0000052895643e+01, number of iterations 5 Note: I may have the number of iterations above off by one Here use "Max iterations %d reached, lx-{n+1) -x-nl %.1e " . = . Store your program in file al_newton.cStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started