In: Electrical Engineering
Determine the value, true or false, of each of the
following Boolean expressions,
assuming that the value of the variable count is 0 and the value of
the variable limit is
10. Give your answer as one of the values true or false.
a. (count == 0) && (limit < 20)
b. count == 0 && limit < 20
c. (limit > 20) || (count < 5)
d. !(count == 12)
e. (count == 1) && (x < y)
f. (count < 10) || (x < y)
g. !( ((count < 10) || (x < y)) && (count >= 0)
)
h. ((limit/count) > 7) || (limit < 20)
i. (limit < 20) || ((limit/count) > 7)
j. ((limit/count) > 7) && (limit < 0)
k. (limit < 0) && ((limit/count) > 7)
l. (5 && 7) + (!6)
Hi teacher this is true false statement please help me out with this thanks
initially count=0, limit = 10,
(a) TRUE
because both the conditions count=0 And limit <20 are true in logical AND operation both codition should be true for result to be TRUE.
(b) TRUE
because both the conditions count=0 And limit <20 are true in logical AND operation both codition should be true for result to be TRUE .
(c) TRUE
(limit > 20) || (count < 5) in this statement logical OR operation , if either one of (limit > 20) and (count < 5)
is true then Output is True . In given Condition count <5 is true so the result is TRUE .
(d) TRUE
!(count == 12) in this statement logical not is used , this statement states that if count is not equal to 12 then the statement is true . Initially count =0 , so the output is TRUE .
(e) FALSE
(count == 1) && (x < y) if one of the condition is fails then the output is False in AND operation .
so the count==1 is False , so the result of statement is FALSE
(f) TRUE
(count < 10) || (x < y) in this statement count< 10 is True so the output is True , in OR operation it does not depent on (x<y ) which is not given .
(g) FALSE
(h) TRUE
(i) TRUE
(j) FALSE
(k) FALSE
(l) 6 (1 1 0)
Taking 3-bit binary
(5 && 7) = 5 ( 1 0 1)
(!6) = 1 (0 0 1)
5 + 1 = 6 (1 1 0)