Program to draw a rectangle#include <graphics.h>
#include <conio.h>
void main()
{
int d,m;
int top,bottom,left,right;
d=DETECT;
initgraph(&d,&m,"c:\\turboc3");
top=getmaxy()/2+50;
bottom=getmaxy()/2-50;
left=getmaxx()/2-50;
right=getmaxx()/2+50;
rectangle(left,top,right,bottom);
getch();
closegraph();
}
Output :
0 comments:
Post a Comment