fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int number;
  5. cout << "Enter a number:";
  6. cin >> number;
  7. if (number %2 == 0) {
  8. cout << "The door opens \n";}
  9. else { cout << "The door stays closed \n"; }
  10.  
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Enter a number:The door stays closed