G
G
Gleb Zubov2019-03-02 12:31:35
Java
Gleb Zubov, 2019-03-02 12:31:35

How to take out the number n from the square root without using mathematical functions?

Good afternoon!
We were given a task at the institute on the subject (Algorithm and data structure).
Write an algorithm that will calculate a number from a square root without using Math. functions.
I looked on the Internet, they always use (sqrt).
Thanks for any help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2019-03-02
@Povedli

The most banal thing that comes to mind is to sequentially loop through the numbers from one to n. Multiply each number by itself until you get the given number.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question