Re: [Dev-C++] DEV-C++ Does Not Pause
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Elizabeth B. <sog...@ya...> - 2002-10-10 14:43:34
|
You could do another cin.
"Administrator" <ad_...@ho...> writes:
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_004F_01C2703F.657C9830
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> //start of code
>
> #include <iostream.h> =09
>
> int main() //Most important part of the program!
>
> {
>
> int age; //Need a variable...
char dummy; // for pausing...
>
> 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=3D=3D100) //I use else just to show an example=20
>
> {
>
> cout<<"You are old"; //Just to show you it works...
>
> }
>
> else
>
> {
>
> cout<<"You are really old"; //Executed if no other statement is =
> executed
>
>
> }
cout << "Hit enter to continue." << endl;
cin >> dummy;
>
> return 0;
>
> }
>
> //end of code
-e
|