C Program to Draw a Rectangle in Graphics

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
void main( )
{
  int gd = DETECT, gm;
  initgraph(&gd, &gm, "C:\\TC\\BGI");
  rectangle(100,100,200,200); //Rectangle(X1,Y1,X2,Y2)
  getch( );
  closegraph( );
}

OUTPUT:

No comments:

Post a Comment