Computer Science, asked by KARTIK3762, 11 months ago

Program to find square root of parameter in c++ without using sqrt

Answers

Answered by kumarkshitij552
0
int sqrt(int x)
{
int quotient = 0;
int i = 0;

bool resultfound = false;
while (resultfound == false)
{
if (i*i == x)
{
quotient = i;
resultfound = true;
}
i++;
}
return quotient;
}
Similar questions