+ 2
How to clear a text after another?
7 Answers
+ 3
use clrscr(); function it erases the CMD screen.
+ 3
yes let's see it
#include <iostream.h >
#include <conio.h>
void main(){
char a;
cout<<"this is the message press any key to remove";
cin>>a;
clrscr() ;
// now you have a cleared screen
}
+ 3
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
cout<<"Hello";
system("pause");
system("cls");
return 0;
}
However, my method only works if you compile the code in an Windoww environment.
+ 1
could you explain how to use it.
0
#include <iostream>
using namespace std;
int main()
{
int age;
cout <<"How old are you.\n";
cin >> age;
(how to clear the word (How old are you) after the input?)
if(age <= 16) {
cout <<"You are too young\n";
cout <<"grow up and become a person xD !!!";
}
else
if(age >= 17 && age <= 41) {
cout << "you are an teenager\n";
cout << "apreciate your precious time !!!";
}
else
if(age >= 42 && age <= 69) {
cout << "you are an adult\n";
cout << "take a good care of your health !!!";
}
else
if(age >= 70) {
cout << "you are an elder\n";
cout <<"time past with an blink of eye right. !!!";
}
return 0;
}
0
ok thanks :D
0
ok thanks for your explanation :D