Friday, December 18, 2020


Use of clrscr function in c with example

 clrscr function in C programming is use to clear the screen and move the arrow upper left-hand corner of your computer screen.

this function work only for the GCC compiler otherwise use clear/cls command.

Example program for clrscr function in c


int main()
   printf("Press any key to clear the screen.\n");



   printf("This appears after clearing the screen.\n");
   printf("Press any key to exit...\n");

   return 0;

As you can see with the help of printf function computer is asking to press any key to clear the screen and then the second message will be displayed.


Post a Comment