/* File: Conditional/inputcond.cpp
Ask for an even integer greater than 5 and less than 100 that is not 20.
If you input something else say "BYE!"
Run1:
Enter even int bigger than 5 smaller than 100 and not 20? 70
Thank you.
Run2:
Enter even int bigger than 5 smaller than 100 and not 20? 20
Good bye.
Relational Operators are:
> greater than
< less than
>= Greater than or equal to
<= Less than or equal to
== Equal to
!= Not equal to
-------------------------------------------------------------- */
#include
using namespace std;
int main() {
int n;
cout << "Enter even int bigger than 5 smaller than 100 and not 20? ";
cin >> n;
if ( ( n > 5 ) && ( n < 100 ) && ( n != 20) && ( n % 2 == 0) )
cout << "Thank you.\n";
else
cout << "Good bye.\n";
/* same as
cout << (( n > 5 && n < 100 && n != 20 && n % 2 == 0) ? "Thank you.\n" : "Good bye.\n");
*/
return 0;
}