Hi all
Please suggest an algorithm to find square root of a big number ( 100+ digits ) in C/C++..

Thank you

Recommended Answers

All 2 Replies

Newton-Raphson, of course. I expect you already implemented addition and division.

You should use Double type of Variable declaration as it is the largest one. You will need #include<math.h> to use the sqrt function.
d=sqrt(a);

you should note that double is the largest size we can use...it will not calculate upto 100 digits...you can calculate something around 15-20 digits... :D

Hope it will clear ur doubt.. ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.