Tuesday, 4 March 2014

Draw Rectangle Using C

#include<conio.h>
#include<graphics.h>
#include<stdio.h>
void main()
{
int gd=DETECT,gm=0;
initgraph(&gd,&gm,"c:\\tc\\bgi");
cleardevice();
     int midx,midy,x,y;
     x=getmaxx();
     y=getmaxy();
     midx=x/2;
     midy=y/2;
     rectangle(midx-110,midy-110,midx+110,midy+110);
     getch();
     closegraph();
}

No comments:

Post a Comment