You are on page 1of 2

Computer Programming 2

Information Sheet 4.1


Activity 2

Program:

#include <iostream>
using namespace std;
main () {

int age;
cout << "Input your age: " ;
cin >> age;

if (age < 13) {


cout << "He is not a teenager." << endl;

} else {
cout << "He is a teenager " ;
if (age<21) {
cout <<"and he is not eligible for marriage.";
} else {
cout <<"and he is eligible." << endl;
}
}
return 0;
}

You might also like