Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.     int age{};
  6.     int has_car{};
  7.     cout << " enter you age : " << endl;
  8.     cin >> age;
  9.    
  10.      if (age < 16) {
  11.         int balance{16};
  12.         balance = (balance - age);
  13.         cout << " come back in : " << balance << " years. " << endl;
  14.      }
  15.    else
  16.     cout << " do you have a car? type 1 for yes and 2 for no. " << endl;
  17.     cin >> has_car;
  18.   if  ( has_car == 2 ) {
  19.      
  20.     cout << " sorry you need a car. " << endl;
  21.     }
  22.        else if  ( has_car == 1 ) {
  23.         cout << " you can drive. " << endl;
  24.     }
  25.    
  26. return 0
  27. ;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement