Thursday, November 5, 2020

Custom Clear Screen using C Program

 /*

  *****************************************************

    CUSTOM CLRSCR() function

    Clear the Screen using HORIZONTAL & VERTICAL wise

  *****************************************************

*/

#include <stdio.h>

#include <conio.h>

#include <dos.h>

void main(){

  int i,j;

  /* ------------------------------ */

  /* Message about Horizontal Clear */

  /* ------------------------------ */

     /* Fill the screen with @ symbol */

     for (i=1; i<=80;i++){

      for (j=1; j<=25; j++){

printf("@");

      }

    }


     gotoxy(20,13);

     textcolor(9);

     cprintf("Custom CLRSCR using HORIZONTAL !");

    /* Perform custom clrscr() by clearing in HORIZONTAL */

    for (j=1; j<=25; j++){

     for (i=1; i<=80;i++){

gotoxy(i,j); /* COLUMN, ROW */

printf(" ");

delay(2);

      }

    }

    /* ------------------------------ */

  /* Message about Vertical Clear */

  /* ------------------------------ */

     /* Fill the screen with @ symbol */

     for (i=1; i<=80;i++){

      for (j=1; j<=25; j++){

printf("@");

      }

    }

     gotoxy(20,13);

     textcolor(9);

     cprintf("Custom CLRSCR using Vertical !");

    /* Perform custom clrscr() by clearing in Vertical */

    for (i=1; i<=80;i++){

    for (j=1; j<=25; j++){

gotoxy(i,j); /* COLUMN, ROW */

printf(" ");

delay(2);

      }

    }

   getch();

}






No comments:

Post a Comment

Popular Posts