1. write an integer function sqrt() (round to closest integer)
You do not need a accurate sqrt function. to calculate y = sqrt(r * r - x * x), you can loop y from r - x to r and compare y * y and r * r - x * x (of course it's better to save r * r - x * x into a variable) and get the closest y.
2.
for (x = 0; x <= r; ++x)
{
y = sqrt(r * r - x * x);
draw points (x, y), (x, -y), (-x, y), (-x, -y)
}
3. there might be some disconnected points when x is close to r. to improve this case, you can save the previous y to y1. if (y1 - y > 1), loop from y1 to y and for each step calculate x1 and draw the 4 points.
You do not need a accurate sqrt function. to calculate y = sqrt(r * r - x * x), you can loop y from r - x to r and compare y * y and r * r - x * x (of course it's better to save r * r - x * x into a variable) and get the closest y.
2.
for (x = 0; x <= r; ++x)
{
y = sqrt(r * r - x * x);
draw points (x, y), (x, -y), (-x, y), (-x, -y)
}
3. there might be some disconnected points when x is close to r. to improve this case, you can save the previous y to y1. if (y1 - y > 1), loop from y1 to y and for each step calculate x1 and draw the 4 points.