In C Graphics we use graphics.h functions. This is used to draw different shapes(like circle,rectangle etc),display text(any message)in different format(different fonts and colors).By using graphics.h we can make programs, animations and also games. We have to call initgraph function which will initialize the graphics mode.
int gdriver = DETECT,gmode;
//initialize graphics mode(passed three arguments to initgraph function)
initgraph(&gdriver,&gmode,"C:\\Turboc3\\BGI");/*&gdriver is the address of gdriver variable,&gmodeis the address of gmode and ,"C:\\Turboc3\\BGI" is the path where BGI files are stored.*/
DETECT is a macro defined in graphics.h which requests initgraph() method to automatically determine which graphics driver to load.
Getmaxx() This function is used only to get the maximum value of X coordinate
Getmaxy() This function is used only to get the maximum value of Y coordinate.