Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Practical 02:- Write a program in C to make a scenery according to

your choice with the help of the built-in-graphics functions.

1. INTRODUCTION

In this report we are using graphics built-in functions to create a very simple look
scenario. As per my choice I have designed a very simple hut using shape functions like
line(), poly(), rectangle(), circle (), arc() etc.

//Source Code.

//graphics programming for design of simple HUT.


#include<conio.h>
#include<graphics.h>
void main () {
clrscr();
int gd =DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setcolor(RED);
setbkcolor(WHITE);
setcolor(RED);
line(140,160,140,280); //frot rectangle
line(140,280,220,280);
line(220,280,220,160);
line(220,160,140,160);
line(180,120,130,170); //trigle
line(180,120,230,170);
setcolor(GREEN);
circle(180,145,10);
setcolor(RED);
line(220,160,380,140); //roof low
line(380,140,380,260);
line(380,260,220,280); //roof top
line(200,280,200,200); //gate right
line(200,200,160,200);
line(180,210,180,270); //door edge verticle
line(160,200,160,280); //gate left
line(160,200,180,210); //door top
line(160,280,180,270); //door low
line(180,120,340,100); //
line(340,100,380,140);
line(250,110,300,150); //roof line
line(280,230,280,271); //winodow
line(280,230,340,220);
line(340,220,340,263);
line(310,225,310,270);
line(280,255,340,245);
outtextxy(130,80,"Adnan's Villa (^_^)");
line(160,280,140,300); //steps
line(200,280,190,300);
line(140,300,140,310);
line(190,300,190,310);
line(140,310,190,310);
line(140,300,190,300);
arc(460,80,0,100,15);
circle(460,80,30);

getch();
closegraph();
}
/*Output*/

You might also like