So I have a question that I now have had for a long time, what are the differences between using else if and chained if statements, don't they produce the same thing? For example take this basic example:
short age {0};
std::cin >> age;
if(age > 18) cout << "You are an adult";
if(age < 18) cout << "YOu are a teen";
if(age == 0) cout << "YOu are born";
and
short age {0};
std::cin >> age;
if(age > 18) cout << "You are an adult";
else if(age < 18) cout << "YOu are a teen";
else if(age == 0) cout << "YOu are born";
How do they differ?