- closegraph() function is used to re-enter in the text mode and exit from the graphics mode. If you want to use both text mode and graphics mode in the program then you have to use both initgraph() and closegraph() function in the program.
- initgraph() function is used to enter in the graphics mode and closegraph() function is used to exit from the graphics mode and also enter in the text mode . Text mode is a default mode.
- This function deallocates all memory allocated by graphics system and restores the screen to that mode in which it was presented before you called the initgraph() function.
outtext(“Enter any key to come outside from the graphics mode”);
Above program tells that closegraph() function is used to exit from the graphics mode and re-enter in the text mode.
When you will execute the above program you will get the following output screen: and now you can enter a character to exit from the program…