Code:
#include<iostream>
using namespace std;
int main()
{
int year_of_birth;
cout<<"Please enter the year you were born below, and It will tell you how much older or younger you are from me\n";
cin>> year_of_birth;
cin.ignore();
if ( year_of_birth < 1980 ) {
cout<<" You are older than me by "<<( 1980 - year_of_birth )<<"year(s)!\n"; //bad logic here, gives negative the other way
}
else { //dont need yearbirth > 1980 unless you were doing an ifelse statement
cout<<" You are younger than me by "<<( year_of_birth -1980 ) << "year(s)!\n"; //forgot an extra "<<" and bad logic again
}
cin.get();
return 0;
}