fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. // your code goes here
  7. int n;
  8. cout<<"Enter a number: "<<endl;
  9. cin>>n;
  10. switch (n) {
  11. case -1:
  12. cout<<"'negative one"<<endl;
  13. break;
  14. case 0:
  15. cout << "zero"<<endl;
  16. break;
  17. case 1:
  18. cout << "positive one"<<endl;
  19. break;
  20. default:
  21. cout << "other value";
  22. break;
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 5660KB
stdin
1
stdout
Enter a number: 
positive one