clrscr function >> conio.h Header file >> Library Functions in C Programming
clrscr function >> conio.h Header file >> Library Functions in C Programming
What it does :
- clears window screen in text mode
- Place the cursor at Position upper left hand corner (1,1)
- Header File : conio.h
#include<stdio.h> #include<conio.h> int main(void) { int i; // Prints 20 numbers for (i = 0; i < 20; i++) printf("%d\n", i); printf("\r\nPress any key to clear screen"); getch(); clrscr(); // Clears the screen printf("The screen has been cleared!"); getch(); }
Output :
The screen has been cleared!