Compare Two Numbers Six Ways
Easyjava
Read two integers and print the result of all six relational operators.
Input: two integers separated by whitespace.
Output: six lines:
== <bool>
!= <bool>
> <bool>
< <bool>
>= <bool>
<= <bool>Example 1
Input
5 3
Output
== false != true > true < false >= true <= false
- -1000000000 <= a, b <= 1000000000
Hint 1
Each expression like (a > b) is already a boolean you can print.
Hint 2
Concatenate the label and the boolean: "> " + (a > b).
Every relational expression evaluates to a boolean. Print each of the six directly. Note that for equal values both >= and <= are true while > and < are false.