Thank you very much i tweaked it a bit. I looked up the == and =. That made a big difference.., the program is working fine now.
Here is the tweaked program.
Code:
#include <iostream>
using namespace::std;
int a;
int b;
int c;
int main()
{
cout<<" Age Check" <<endl;
cout << "Enter the current year "<< "\n";
cin>>a;
cout << " Enter the year born" << "\n" ;
cin>>b;
cout <<" If born on January press 1 if born after press 0"<<"\n";
cin>>c;
if (c == 1)
{
int result2 (2011- a);
cout <<" You are : " <<result2<<"\n";
cin>>result2;
getchar(),getchar(),getchar(),getchar();
}
else if (c == 0)
{
int result = ( a - b );
cout << " You are : " <<result<<endl;
cin>>result;
getchar(),getchar(),getchar(),getchar();
return 0;
}
}