Advertisement
apl-mhd

Clear screen in c++

Apr 4th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. using namespace std;
  4. int main(void)
  5. {
  6.    
  7.    
  8.    
  9.    
  10.      cout << "\tHi, there!\n\n";
  11.      cout << "\nComputers are";
  12.      cout << "great!\n";
  13.      
  14.        
  15.          
  16.        
  17.    
  18.     cout<<"do you want to clear your screen? press 1";
  19.    
  20.     int x;
  21.     cin>>x;
  22.    
  23.     if(x == 1)
  24.    
  25.      cout << "\033[H\033[2J";
  26.    
  27.        
  28.  
  29.    
  30.    
  31.  
  32.      return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement