Administrator
2002-10-10 12:28:01 UTC
//start of code
#include <iostream.h>
int main() //Most important part of the program!
{
int age; //Need a variable...
cout<<"Please input your age: "; //Asks for age
cin>>age; //The input is put in age
if(age<100) //If the age is less than 100
{
cout<<"You are pretty young!"; //Just to show it works
}
else if(age==100) //I use else just to show an example
{
cout<<"You are old"; //Just to show you it works...
}
else
{
cout<<"You are really old"; //Executed if no other statement is executed
}
return 0;
}
//end of code
when I enter "my age" then I must press <ENTER> to run the if statements, The DOS window stays up till i press <ENTER> to process.
I cant get the movie to pause and give me the result "You are old". "You are really old" or whatever the result must be.
How can I pause the movie and process it?
I tried:
//code
system("PAUSE");
return 0;
}
//code
but this just trows an error.
Also I tried to run the EXE by itself, but again, it does the same thing
Thanks for your help
#include <iostream.h>
int main() //Most important part of the program!
{
int age; //Need a variable...
cout<<"Please input your age: "; //Asks for age
cin>>age; //The input is put in age
if(age<100) //If the age is less than 100
{
cout<<"You are pretty young!"; //Just to show it works
}
else if(age==100) //I use else just to show an example
{
cout<<"You are old"; //Just to show you it works...
}
else
{
cout<<"You are really old"; //Executed if no other statement is executed
}
return 0;
}
//end of code
when I enter "my age" then I must press <ENTER> to run the if statements, The DOS window stays up till i press <ENTER> to process.
I cant get the movie to pause and give me the result "You are old". "You are really old" or whatever the result must be.
How can I pause the movie and process it?
I tried:
//code
system("PAUSE");
return 0;
}
//code
but this just trows an error.
Also I tried to run the EXE by itself, but again, it does the same thing
Thanks for your help