1. in1 = True
in2 = False
out = in1 and in2
What is the value of out?
True or False?
2.
in1 = False
in2 = False
out = not in1 and (in2 or not in1)
What is the value of out? True or False?
3.
in1 = True
in2 = False and not in1
in3 = in1 and in2
out = in1 and not in3
What is the value of out? True or False
1. Value of out is 'false'
EXPLANATION:
'and' gives result 'true' when both the conditions are true but if either of them is false then overall the result is 'false'.
So,
true and false = false
Therefore, out= false
2. The value of out is 'true'
EXPLANATION:
Or returns true if one of the conditions is true and returns false if both the conditions care false.
not in1: returns opposite of in1
Since in1 is false, so
not in1= true
Overall,
out= true and (false or true)
out= true and true
out= true
3. The value of out is True
EXPLANATION:
in1= True
in2= False and False
= False
in3= True and False
= False
out= True and True
out= True
Get Answers For Free
Most questions answered within 1 hours.