cleardevice() is a function which is used to clear the screen by filling the whole screen with the current background color. It means that cleardevice() function is used to clear the whole screen with the current background color and it also sets the current position to (0,0). . Both clrscr() and cleardevice() functions are used to clear the screen but clrscr() is used in text mode and cleardevice function is used in the graphics mode.
outtext(“enter any character to clear the screen:”);
outtext(“enter any character to exit………………”);
Above program shows the use of function cleardevice() in the C graphics..
After running the above program first of all a circle with radius 100cm and a message “enter any character to clear the screen” will display on the screen as given below: And when we input any character then screen will be cleared and a message will be produced “enter any character to exit………………” as given below: and now you can enter a character to exit from the program…