Correct answer is 2.

If A = B = 0, there is no potential anywhere here
V0 = 0
If A = 1, B = 0, Diode D1 is forward biased, here
V0 = 5V
If A = 0, B = 1, Diode D2 is forward biased hence
V0 = 5V
If A = 1, B = 1, Both diodes are forward biased
hence V0 = 5V
Truth table for Ist

\(\therefore\) Given circuit is OR gate
For IInd circuit
VB = 5V, A = 1
VB = 0V, A = 0
When A = 0, E – B junction is unbiased there is no current through it
\(\therefore\) V0 = 1
When A = 1, E – B junction is forward biased V0 = 0
\(\therefore\) Hence this circuit is not gate.