You are on page 1of 7

Experiment Title

Student Name: Gurpreet Singh UID: 19BCS1961


Branch: BE-CSE Section/Group: K3/A
Semester: 5th Date of Performance: 01/09/2021
Subject Name: Computer Graphics Subject Code: CSP-305

1. Aim/Overview of the practical:


To display simple shapes (Like hut, star, car etc.) using graphics primitives.

2. Task to be done/ Which logistics used:

We have to create different shapes using graphics.h library by using different method like

Line , circle, Rectangle, and drawpoly.


3. Steps for experiment/practical/Code:

Hut:
#include<graphics.h>
#include<conio.h>

main ()
{

int gd = DETECT, gm;


initgraph (&gd, &gm,"");
{
rectangle (150,180,250,300);
rectangle (250,180,420,300);
rectangle (180,250,220,300);

line (200,100,150,180);
line (200,100,250,180);
line (200,100,370,100);
line (370,100,420,180);

circle (350,250,25);
line (375,250,325,250);
line (350,225,350,275);

getch ();
closegraph ();
}

Star:
#include<graphics.h>
#include<conio.h>

main ()
{

int gd = DETECT, gm;


initgraph (&gd, &gm,"");
int n [] = {300,100,325,150,375,150,350,200,
375,250,325,250,300,300,275,250,
225,250,250,200,225,150,275,150,300,100};
drawpoly (13, n);

getch ();
closegraph ();
}

CAR:
#include<graphics.h>

#include<conio.h>

main ()
{

int gd = DETECT, gm;


initgraph (&gd, &gm,"");
{
line (125,200,150,125);
line (150,125,325,125);
line (325,125,325,200);
rectangle (100,200,350,250);
arc (175,250,180,360,25);
arc (275,250,180,360,25);

getch ();
closegraph ();
}
4. Result/Output/Writing Summary:

Hut:
Star:
Car:

Learning outcomes (What I have learnt):

1. Learnt About graphics.h

2. Learn about arc, line, circle, reangle.


3. Learn about drawpoly

4. Learn about how to draw different spaces using graphics.h

5. Learn about how to draw different spaces using graphics.h


Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):
Sr. No. Parameters Marks Obtained Maximum Marks
1.
2.
3.

You might also like