-
you have a small error in the code.
Code:
#include <iostream.h>
int 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 it works
}
else if(age==100) //I use else just to show an example
{
cout<<"You are old"; //Just to show you it works...
}
else
{ < you have an opening brace here
cout<<"You are really old"; //Executed if no other statement is executed
< but no closeing brace here
cin.get();
cin.get();
return 0;
}
may i also sugest that if compiler 4 is dev-c++ 4, get the new dev-cpp 5. a cupple of things are different in the codeing.
not all headers need .h at the end eg. #include <iostream.h> becomes #include<iostream>
and you will need to include using namespace std; then when useing the iostream.