I'm stuck and can't seem to solve this issue.
Here's the task that I need to do:
"Ask the user for two users' ages and indicate who is older, behave differently if both are over 100.
I get the error:
Expected primary-expression before '>' token. (Line 19)
This is my 4th day learning C++, so any advice is greatly appreciated.
Am I on the right track with the code below?
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
int age_1;
int age_2;
cout << "Please enter the age of user one: " << "\n";
cin >> age_1;
cout << "Please enter the age of user two: " << "\n";
cin >> age_2;
if (age_1 > age_2)
cout << "User 1 is older then User two!" << "\n";
elseif (age_1 && age_2 == >100)
{ cout << "You guys are old!" << "\n";
}
else (age_1 < age_2);
{
cout << "User 1 is younger then User two!" << "\n";
}
cin.ignore();
}