How to clear screen in C Language
We can clear screen in C language according to the compiler.
- Using clrscr() - For TurboC Compiler
- Using system("cls") - For gcc/g++ & TurboC Compiler windows
- Using system("clear") - For gcc/g++ compiler in Linux
/* TurboC Compiler */
#include
#include /*for clrscr()*/
int main(){
int num=100;
/*Use after declaration section*/
clrscr(); /*clear output screen*/
printf("value of num: %d\n",num);
return 0;
}
/* GCC compiler and TurboC Compiler For Windows */
#include
#include /*for system()*/
int main(){
int num=100;
/*Use after declaration section*/
printf("Not display due to clearscr");
system("cls"); /*clear output screen*/
printf("value of num: %d\n",num);
return 0;
}
/* gcc/g++ compiler Linux */
#include
#include /*for system()*/
int main(){
int num=100;
/*Use after declaration section*/
system("clear"); /*clear output screen*/
printf("value of num: %d\n",num);
return 0;
}
agyanadda
Author & Editor
Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.
Slots Casino Review | Safe or Scam?
ReplyDeleteRead our full 포커 에이스 review 슬롯 머신 of this Casino Online in Mexico in 2021, 바카라 추천 what bonuses it offers and how to play them. Find out 네이버 룰렛 which 도박사이트 are worth playing.