rectangle function of c graphics

C program to draw rectangle in c graphics.
  • 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;
}


rectangle function of c graphics


Download


0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.