Okay, some hints follow. You always start with requirements analysis.

So, the task is to implement function sqrt. This implies you already have some experience in using/writing C/C++ functions.
...