Find the square root of 50 using Guess and Check and Bisection algorithms.

Here is the code of finding the square root of 50 using Guess and Check and Bisection algorithms.


#Finding the square root of 50 using Guess and Check and Bisection algorithms.

square = 50
low = 0
high = square
guess = (high + low) / 2
error = 0.000000001
while abs(guess**2 - square) >= error:
    if guess**2 < square:
        low = guess
    else:
        high = guess
    guess = (high + low) / 2.0
print(guess, 'is the approx square root of 50.')

# This code is contributed by Ahmad Shafiq

.

callout-flag

Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

Author

Leave a Reply

girl-carrying-document

More Articles.

girl-carrying-document

More Articles.