Write a function to determine the squareroot of a number


Question : squareroot

Write a function to determine the squareroot of a number.

The squareroot of a number can be approximated by repeated calculation using the formula

NG = 0.5(LG + N/LG)

where NG stands for the next guess and LG stands for the last guess.

The loop should repeat until the difference between NG and LG is less than 0.00001.

Use an initial guess of 1.0. Write a driver program to test your squareroot function.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a function to determine the squareroot of a number
Reference No:- TGS02929442

Expected delivery within 24 Hours