The graphics.h library in Turbo C provides functions to draw different shapes on the graphics screen. In this program, a circle, lines, and a rectangle are drawn using built-in graphics functions.
How It Works?
graphics.h header file.initgraph().setcolor().circle() function.line() function.rectangle() function.getch().#include <stdio.h> #include <conio.h> #include <graphics.h> main() { int gd = DETECT, gm; initgraph(&gd, &gm, "c:\\turboc3\\bgi"); setcolor(1); circle(400, 150, 30); setcolor(7); line(300, 200, 300, 450); line(150, 200, 50, 200); setcolor(15); rectangle(500, 100, 300, 200); getch(); }