0% found this document useful (0 votes)
17 views2 pages

Graphics Programming in C++

The document contains a C++ program that utilizes the graphics.h library to create simple geometric shapes on the screen. It initializes a graphics window, draws a circle, rectangle, line, arc, ellipse, and triangle, and labels each shape with text. The program concludes by waiting for a key press before closing the graphics window.

Uploaded by

kamal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Graphics Programming in C++

The document contains a C++ program that utilizes the graphics.h library to create simple geometric shapes on the screen. It initializes a graphics window, draws a circle, rectangle, line, arc, ellipse, and triangle, and labels each shape with text. The program concludes by waiting for a key press before closing the graphics window.

Uploaded by

kamal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <conio.

h>

#include <graphics.h>

int main()

clrscr();

int gd = DETECT, gm;

initgraph(&gd, &gm, "c:\\turboc3\\bgi");

setbkcolor(2);

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");

arc(80, 350, 10, 80, 100);

outtextxy(100, 340, "ARC");

ellipse(380, 300, 0, 360, 40, 80);

outtextxy(355, 300, "ELLIPSE");

line(200, 400, 300, 300);

line(300, 300, 400, 400);

line(400, 400, 200, 400);

outtextxy(270, 410, "TRIANGLE");


getch();

closegraph();

return 0;

You might also like