AshfaqFardin

Check if 18

Jul 30th, 2021
887
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int currentYear = 2021;
  8.     int birthYear = 0;
  9.     cin >> birthYear;
  10.    
  11.    
  12.     int ageInYear = currentYear - birthYear;
  13.    
  14.     if(ageInYear > 17){
  15.         cout << "You can cast vote\n";
  16.     }
  17.     else{
  18.         cout << "You can't vote";
  19.     }
  20.    
  21.     return 0;
  22. }
RAW Paste Data