home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP30-3.ZIP
/
EXAMPLES.ZIP
/
EX2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-18
|
711b
|
30 lines
// Borland C++ - (C) Copyright 1991 by Borland International
// ex2.cpp: An interactive example
// from Hands-on C++
#include <iostream.h>
main()
{
char name[16];
int age;
cout << "Enter your name: ";
cin >> name;
cout << "Enter your age: ";
cin >> age;
if (age < 21)
cout << "You young whippersnapper, " << name << "!\n";
else if (age < 40)
cout << name << ", you're still in your prime!\n";
else if (age < 60)
cout << "You're over the hill, " << name << "!\n";
else if (age < 80)
cout << "I bow to your wisdom, " << name << "!\n";
else
cout << "Are you really " << age << ", " << name << "?\n";
return 0;
}