Pages

clrscr() Function in C/C++ Language

Function Name: clrscr()                           
Function Header: <CONIO.H>
Declaration:  void clrscr(void);
Return ValueNone

Notes

This function performs to clear text mode window. It clears the current text window and places the cursor in the upper left-hand corner (at position 1, 1). If we don’t use this function we’ll see the previous output window written any text. 

Example

#include<stdio.h>
#include <conio.h>

 {
     int i;
    clrscr();
    for( i = 0; i < 10; i++)
    printf("clrscr function test\n");
    printf("\n\nPress any key to clear screen");
    getch();

    clrscr();
    printf("The screen has been cleared!");
    getch();
 }

Output




When we press any key, we’ll find the flowing 

 Output





3 comments:

Anonymous said...

Hello there! I know this is kinda off topic however , I'd figured I'd ask.

Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?

My blog covers a lot of the same topics as yours and I think we could greatly benefit from each other.
If you're interested feel free to shoot me an email. I look forward to hearing from you! Awesome blog by the way!

Also visit my homepage ... vakantiehuisjes frankrijk

Dante Giova said...

Para que corra el programa acordate/acuerdense de poner
#include
#include
en el borland me falto eso para que corra... saludos

Nirjhar Kundu said...

use it same in c ++
for clear screen
use #include
void main()
{
int a,b;
clrscr();
-----
----

}