fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int n,r;
  5. std::cout << "enter a number";
  6. std::cin >> n;
  7. r=n%2;
  8. cout<<(r==0?"\neven":"\nodd");
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0s 3300KB
stdin
-101
stdout
enter a number
odd