In: Computer Science
Check off the equations below that are accurate
A , B, C are numeric variables
A = 3, B= 2, C = 1
note , the symbol == means a test for equality, not assignment..
3 * 5 > 2 * 6 is True |
||
A > B or A < C is True |
||
3 + 5 > 2 + 6 is True |
||
A > B and not ( A < C) is True |
||
A < 5 or A == 5 or A >5 is True |
||
3 > 1 or 3 == 1 is True |
Given A=3, B=2 and C=1
a) 3* 5 > 2* 6
Sol: 3 *5 > 2* 6
-> 15 > 12
-> true
3 * 5 > 2 * 6 is TRUE
-----------------------------------------
b) A > B or A < C
-> here A= 3, B= 2 and C=1
-> 3 > 2 or 3 < 1
->true or false
-> TRUE
A > B or A <C is TRUE
--------------------------------------------
c) 3 + 5 > 2 + 6
-> 3+5 > 2 + 6
-> 8 > 8
-> False
3 + 5 > 2 + 6 is FALSE
--------------------------------------------
d) A > B and not (A<c)
-> A > B and not(A < C)
-> 3 > 2 and !(3 < 1)
-> 3 > 2 and !(False) !(false) = true and !(true) = false
-> 3>2 and True
-> true and true
-> True
A > B and not(A <C) is TRUE
------------------------------------
e) A < 5 or A == 5 or A > 5
-> 3 < 5 or 3 == 5 or 3 > 5
-> true or false or false
-> TRUE
A < 5 or A == 5 or A > 5 is TRUE
-----------------------------------------
f) 3 > 1 or 3 == 1
-> true or false
-> true
3 > 1 or 3 == 1 is TRUE
---------------------------------------