cleardevice() function

cleardevice function clearsthe screen in graphics mode and sets the currentposition to (0,0). Clearing the screenconsists of fillingthe screen with current background color.

Declaration of cleardevice() function

void cleardevice();

C program for cleardevice

#include<graphics.h> 
#include<conio.h>
main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\\ TurboC3\\BGI");
outtext("Press any key to clear the screen."); 
getch();
cleardevice();
outtext("Press any key to exit...");
getch(); 
closegraph(); 
return 0;
}