graphics.h Header File in C Programming

The ‘graphics.h’ header file is used to declare graphics functions. It declares prototypes for the graphics functions.

Some of the standard member functions of graphics.h header files are,
Function Name	Description
initgraph -	Used to initilize graphics and load graphics 
line 		Used to draw a line as line(x1,y1,x2,y2).
bar -		Used to draw rectangle with diagonal, 
circle -	Used to draw circle, circle(x1,y1,radius).
cleardevice -	It clears the graphics screen.
closegraph -	Closes or shut downs graphics system.
rectangle -	Used to draw a rectangle.
setcolor -	It sets the current drawing color.
getcolor -	It returns the current drawing color.
floodfill -	Used to flood-fill bounded region.
settextstyle -	It sets current text features.
ellipse -	It draws ellipse, as 

Program :

/*  Program to demonstrate graphics.h header file working.
Creation Date : 6:12 PM 08/11/2010
Author : [Technowell, Sangli] */

#include <stdio.h>
#include <conio.h>
#include <graphics.h>

int main(void)
	int gdriver=DETECT, gmode;
	return 0;

Output :

Leave A Comment

Your email address will not be published. Required fields are marked *