Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int age{};
- int has_car{};
- cout << " enter you age : " << endl;
- cin >> age;
- if (age < 16) {
- int balance{16};
- balance = (balance - age);
- cout << " come back in : " << balance << " years. " << endl;
- }
- else
- cout << " do you have a car? type 1 for yes and 2 for no. " << endl;
- cin >> has_car;
- if ( has_car == 2 ) {
- cout << " sorry you need a car. " << endl;
- }
- else if ( has_car == 1 ) {
- cout << " you can drive. " << endl;
- }
- return 0
- ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement