The products A and B in the following reactions, respectively are

For halogenated alkanes the nature of the ambident nucleophile and the metal ion that accompanies it (Na+ or Ag+) decides whether substitution occurs through the carbon-end or the hetero-atom-end of the nucleophile.
Case 1 (formation of A):
Reagent used: (silver nitrite).
• Nitrite ion is an ambident nucleophile: has a negatively charged oxygen while the nitrogen also possesses a lone pair.
• In the presence of the reaction proceeds via a polar SN1-type mechanism that involves formation of a carbocation. Because strongly bonds with the leaving halide (AgCl ppt), the intermediate is generated; recombination occurs predominantly through the nitrogen end of the nitrite ion, giving a nitroalkane .
Hence for 1-chloropropane the product is (1-nitropropane).
Case 2 (formation of B):
Reagent used: (silver cyanide).
• Cyanide ion is also ambident: can attack through carbon (to give nitrile) or through nitrogen (to give isocyanide).
• With , as before, a carbocation is produced. Attack now favours the lone pair on nitrogen, so the isomer formed is an isocyanide (isonitrile) rather than the usual nitrile obtained with alkali metal cyanides.
Therefore from 1-chloropropane the product is (propyl isocyanide).
Thus,
A =
B =
Option D which is: is the correct answer.
Tagged Nucleophilic substitution (SN1 and SN2). Machine-assigned, so read it as a strong shortlist rather than a verdict.