fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i = 15;
  8.  
  9. if ( !(i%2 == 0) )
  10. cout << i << " is odd." << endl;
  11. else
  12. cout << i << " is even." << endl;
  13.  
  14. if (i%5 != 0)
  15. cout << i << " is not divisible by 5." << endl;
  16. else
  17. cout << i << " is divisible by 5." << endl;
  18.  
  19. if ( !(i == 15) )
  20. cout << i << " is not equal to 15." << endl;
  21. else
  22. cout << i << " is equal to 15." << endl;
  23.  
  24. if ( !(i < 20) )
  25. cout << i << " is greater or equal than 20." << endl;
  26. else
  27. cout << i << " is smaller than 20." << endl;
  28.  
  29. if ( !(i*2 <= 25) )
  30. cout << i << "*2 is greater than 25." << endl;
  31. else
  32. cout << i << "*2 is smaller or equal than 25." << endl;
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
15 is odd.
15 is divisible by 5.
15 is equal to 15.
15 is smaller than 20.
15*2 is greater than 25.