hello, brand new here, need help with inputting data
okay, so i have this basic program (from the tutorials section), this is what it is:
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;
}
anyways, so the problem is, i run the console program and i get prompted :how old are you, so i put in a number and hit enter, then the window just dissappears, this has happened with all my programs that require data inputted.
any help would be great! thanks
and BTW, I did do a search, and didn't find anything.