1. #include <iostream>
2.
3. using namespace std;
4.
5. int main()
6. {
7. int i = 15;
8.
9. if ( (i >= 10) && (i <= 20) )
10. cout << i << " is between " << 10 << " and " << 20 << endl;
11. else
12. cout << i << " isn't between " << 10 << " and " << 20 << endl;
13.
14. if ( (i >= 20) && (i <= 30) )
15. cout << i << " is between " << 20 << " and " << 30 << endl;
16. else
17. cout << i << " isn't between " << 20 << " and " << 30 << endl;
18.
19. if ( (i <= 10) || (i%4 == 0) )
20. cout << i << " is smaller or equal than " << 10 << " or it is divisible by " << 4 << endl;
21. else
22. cout << i << " isn't smaller or equal than " << 10 << " and it isn't divisible by " << 4 << endl;
23.
24. if ( (i <= 8) || (i%3 == 0) )
25. cout << i << " is smaller or equal than " << 8 << " or it is divisible by " << 3 << endl;
26. else
27. cout << i << " isn't smaller or equal than " << 8 << " and it isn't divisible by " << 3 << endl;
28.
29. return 0;
30. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
15 is between 10 and 20
15 isn't between 20 and 30
15 isn't smaller or equal than 10 and it isn't divisible by 4
15 is smaller or equal than 8 or it is divisible by 3