CPP Age Check
CPP
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 } }
|