SRL Archive - C/C++ Help and Tutorials

Simple script


HarryJames

2009-02-16 13:21:21

So then, Me and my freind decided to start and learn C++. I have not got and compilers or anything yet but using some variable and If tutorials I made this.

Two things, Will it work and will it work more than once without having to restart the script?


#include <iostream>
using namespace std;

int main()
{
int Age;
cout<<"How old are you?\n";
cout<<"Please enter your age: ";
cin>> Age;
cin.ignore();
if ( Age < 12 )
cout<<"Wow, You're not even a teenager yet!\n";
if ( Age <= 18 || age >= 13 )
cout<<"So then, Past the kiddy years and now a teenager!\n";
if ( Age <= 64 || >= 19 )
cout<<"Ooh, the most boring bit of your life, work TT\n";
if ( Age <= 65 ) {
cout<<"Now, If you havent retired then quickly RETIRE!!!\n";
cout<<"Congratulations on becoming "<< thisisanumber <<"\n";
cout<<"I hope that you have a great "<< (Age + 1)<<"th birthday!\n";
}

Torrent of Flame

2009-02-16 13:26:45

21th birthday :D

great "<< (Age + 1)<<"th birthday!