The output voltage in the following circuit is (consider ideal diodes): a $+5\ \text{V}$ supply feeds the output node through a resistor; diode $D_1$ connects the node to a $+5\ \text{V}$ terminal and diode $D_2$ connects the node to ground, both with their anodes at the node, as shown in the figure.
Answer: (B) $0\ \text{V}$
$D_2$ has its anode at the node and its cathode at ground. The node is pulled up through the resistor, so $D_2$ is forward biased and, being ideal, clamps the node to $0\ \text{V}$.
$D_1$ then has $0\ \text{V}$ at its anode and $+5\ \text{V}$ at its cathode: reverse biased, so it carries no current.
The whole $5\ \text{V}$ drops across the resistor and $V_{\text{out}} = 0\ \text{V}$. (This is a diode AND gate with inputs 1 and 0.)
Solution by Sreeraj P, M.Sc Physics