clrscr

Overview :

This function is used to clear the screen in text mode and return the cursor to position(0,0).

Syntax :
void clrscr();
Description :
  • clrscr is used to clear the screen.
  • clrscr return the cursor to position(0,0).

"clrscr" function does not return any value.
Example :
#include<stdio.h>
#include<conio.h>

void main()
{
  printf("\nPress any key to clear the screen : ");
  getch();
  clrscr();
  printf("\nEnter any key to exit : ");
  getch();
}

Comments

comments powered by Disqus