Draw a Circle in C — Midpoint Circle Algorithm (No graphics.h)

The classic way this exercise was taught — Turbo C’s <graphics.h> with initgraph() and circle(x, y, r) — hasn’t compiled on a mainstream system in decades: graphics.h was a Borland DOS library, not part of C. But the underlying question is still excellent: how does a computer decide which pixels form a circle? The answer …