C program to draw rectangle in c graphics.
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
initgraph(&gd,&gm,"C:\\tc\\bgi");
rectangle(100,100,400,300);
getch();
closegraph();
return 0;
}
- Syntax of rectangle function is rectangle(left, top, right, bottom);
- Rectangle is used to draw empty rectangle.
- It takes 4 arguments all of int types.
- First two arguments are left-top corner of the rectangle and last two arguments are right-bottom corner of the rectangle.
C program to draw rectangle
#include <graphics.h>
#include <stdio.h>
int main( )
{
int gd=DETECT, gm;
initgraph(&gd,&gm,"C:\\tc\\bgi");
rectangle(100,100,400,300);
getch();
closegraph();
return 0;
}
Download |
---|
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.