#include #include #include #include void main() { int GraphDriver; /* The Graphics device driver */ int GraphMode; /* The Graphics mode value */ struct point { int x,y; } p1,p2; int radius; float x,y,t,i; printf("give me the circle point--->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the radius --->"); scanf("%d",&radius); getche(); GraphDriver = DETECT; /* Request auto-detection */ initgraph( &GraphDriver, &GraphMode, "" ); /* just increasing p1 - p2 */ setcolor(14); circle(p1.x,p1.y,radius); getche(); clearviewport(); for (i=p1.x-radius; i<=p1.x+radius; i+=0.5) { t=sqrt(radius*radius-(i-p1.x)*(i-p1.x)); y=p1.y+t; putpixel(i,(int)y,2); y=p1.y-t; putpixel(i,(int)y,3); delay(20); } getche(); closegraph(); /* Return the system to text mode */ }