#include #include #include #include #define MAX 40 void main() { int Driver, Mode; /* The Graphics device driver */ struct point { int x,y; } p1,poly[MAX]; int radius,i,k,j,n; float d,x,y; printf("give me the center--->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the radius -->"); scanf("%d",&radius); printf("give me the max polygon-->"); scanf("%d",&n); getche(); Driver = DETECT; initgraph( &Driver, &Mode, "" ); d=2*3.14159/n; setcolor(4); for (i=0; i<=n; i++) { poly[i].x=x=p1.x+radius*cos(d*i); poly[i].y=y=p1.y+radius*sin(d*i); if (i == 0) moveto(x,y); else lineto(x,y); } for (i=0; i