C Programming MCQ

1:

The operation of a staircase switch best explains the 

A.

or operation

B.

and operation

C.

exclusive nor operation

D.

exclusive or operation

 

Answer : D

Explanation :

First from the truth table of the exclusive OR operation.If both the switches are off i-e 0, 0 then the light will be off i-e, 0. So, 0, 0 yields 0.If you switch on either of the two switches i-e. 0 1 or 1 0, the light will be on. So, 0 1 yields 1 (so does 1 0 ).Now, if you switch on the other one, which is currently off, it will be 1 1. This should yield a 0. Compare these results with the truth table of XOR.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.