C Program to Draw a HUT using Line, Rectangle and Circle 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);
  line(120,80,180,80);
  line(120,80,100,100);
  line(180,80,200,100);
  line(130,80,110,100);
  line(140,80,120,100);
  line(150,80,130,100);
  line(160,80,140,100);
  line(170,80,150,100);
  line(180,80,160,100);
  circle(180,93,3);
  rectangle(140,170,160,200);
  line(150,170,150,200);
  rectangle(120,120,130,140);
  rectangle(170,120,180,140);
  circle(150,150,10);
  line(100,150,140,150);
  line(160,150,200,150);
  getch( );
  closegraph( );
}

OUTPUT:


No comments:

Post a Comment