closegraph() function
closegraph function closes the graphicsmode, deallocates all memory allocated by graphics systemand restores the screen to the mode it was in before you called initgraph.
Declaration of closegraph() function
void closegraph();
C code of closegraph
#include<graphics.h>
#include<conio.h>
main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\\ TurboC3\\BGI");
outtext("Press any key to close the graphics mode...");
getch();
closegraph();
return 0;
}