DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
                             Experiment 1
Student Name: Aryan Gora                        UID: 22BCS12156
Branch: CSE                                     Section/Group: 22BCS_IOT_620-B
Semester: 6                                     Date of Performance:14-01-2025
Subject Name: Computer Graphics Lab             Subject Code: 22CSH-352
1. Aim:
  Demonstrate the use of graphics.h functions to draw basic shapes like lines,
  triangles, and circles.
2. Objective:
  To familiarize students with using the graphics.h library to create basic shapes like
  lines, triangles, and circles.
3. Implementation/Code:
  #include <graphics.h>
  #include <conio.h>
  void main() {
    clrscr();
     int gd = DETECT, gm;
     initgraph(&gd, &gm, "c:\\turboc3\\bgi");
     setbkcolor(9);
     setcolor(WHITE);
  circle(100, 100, 50);
  outtextxy(75, 98, "CIRCLE");
     rectangle(210, 60, 400, 140);
  outtextxy(270, 100, "RECTANGLE");
  line(455, 85, 555, 85);
     outtextxy(490, 95, "LINE");
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
     arc(80, 350, 10, 80, 100);
     outtextxy(100, 340, "ARC");
      ellipse(380, 300, 0, 360, 40, 80);
   outtextxy(355, 300, "ELLIPSE");
   getch();
   closegraph();
   }
4.Output:
5. Learning Outcome:
   a) Gain an understanding of how the graphics system works in Turbo C++ using
      the graphics.h library, including initializing the graphics mode, setting the
      background and foreground colors, and understanding the basic functions for
      drawing shapes.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
  b) Draw basic geometric shapes like lines, triangles, and circles using simple
     functions such as line(), circle(), and polygon(). Students should be able to
     visualize and position these shapes on the graphics window.
  c) Learn how to modify the position, size, and orientation of shapes by altering
     their coordinates. This will give them control over where and how the shapes
     appear on the screen.