The graphics.h library provides functions to draw and fill different graphical objects. In this program, graphics mode is initialized, text is displayed, a filled ellipse is drawn, and two filled rectangles are created using different fill styles.
How It Works?
graphics.h header file.initgraph().setcolor().outtextxy().setfillstyle().fillellipse().bar().getch().#include <stdio.h> #include <conio.h> #include <graphics.h> main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\Turboc3\\Bgi"); setcolor(3); settextstyle(4, 0, 4); outtextxy(400, 70, "Graphics"); setfillstyle(7, 3); fillellipse(100, 150, 90, 70); bar(200, 50, 250, 280); setfillstyle(8, 3); bar(300, 50, 360, 250); getch(); }