#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
clrscr();
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int radius = 200;
int ymax,xmax;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\TC\BGI");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %sn", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
xmax=getmaxx();
ymax=getmaxy();
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
line(120, midy, 519, midy);
for(int x=midx;midx<100;midx++)
{
line(x,239,176,100);
}
line(midx, 40, midx,438);
/* draw the circle */
circle(midx, midy, radius);
circle(midx, midy, radius=50);
circle(midx, midy, radius=70);
circle(midx, midy, radius=90);
circle(midx, midy, radius=110);
circle(midx, midy, radius=130);
circle(midx, midy, radius=150);
circle(midx, midy, radius=170);
circle(midx, midy, radius=30);
circle(midx*1.3,midy*1.5,radius=8);
circle(midx, midy/5.6, radius=30);
circle(midx, midy*1.84, radius=30);
circle(midx=getmaxx()/5.3, midy, radius);
circle(midx=getmaxx()/1.23, midy, radius=30);
/* clean up */
getch();
closegraph();
return 0;
}