Change your code like that:
void getSqrRoot(char* buff, int x)
{
sprintf(buff, “The sqaure root is: %f”, sqrt((float)x));
}
Because square root is overloaded function compiler has no opportunity to implicit conversion from int x value to float or double value, you need to do it directly.
Compiler: see sqrt(int) -> what to choose? sqrt(float)/sqrt(double) ?
Compiler: see sqrt((float)int) -> sqrt(float), ok!
Compeler: see sqrt((double)int) -> sqrt(double), ok!