Code Library
Home Submit Free Hosting Link To Us Contacts

CPP Age Check

CPP Age Check CPP CPP Age Check Download (.zip)



#include <iostream.h>                        //For output
#include <conio.h>                        //For getch()

void 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 you the output
}
if(age==100)                                //Remember, if the age equals 100 needs two =
{
cout<<"You are old";                //Just to show you it works...
}
if(age>100)
{
cout<<"You are really old";                //Proof that it works for all conditions
}
}




  • CPPAge Check


CPP Age Check