Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how can i write code for square roots of a number

+11 votes
asked May 7 by Arthur Lukuwi (220 points)

3 Answers

0 votes
answered May 7 by ProAstroShan (140 points)
It is as simple as raising the number to the power of half. For example in python, you could:

num_squared = num ** 0.5
0 votes
answered May 11 by Peter Minarik (101,340 points)
Most languages have libraries that offer such functionality.

What language are you looking for?

Writing a function that calculates the square root without using library functions is a different kind of beast. :)
+1 vote
answered May 14 by Alec (220 points)
depends on the language, but in python you can use sqrt() to achieve this.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...