Ethyl chloride is treated with AgCN in to give 'A' (Major Product), and with NaCN in to give 'B' (Major Product), as shown.
Considering the above reactions, the compound 'A' and compound 'B' respectively are :

From the JEE Main 2022 · 29 Jul · Shift 1 paper. Try it, check your answer, then read the worked solution below.
Ethyl chloride is treated with AgCN in to give 'A' (Major Product), and with NaCN in to give 'B' (Major Product), as shown.
Considering the above reactions, the compound 'A' and compound 'B' respectively are :

Try it yourself first, then check your working against this.
Worked solution
Ambident cyanide. AgCN is largely covalent, so attack is through N and gives ethyl isocyanide. NaCN is ionic, and the more nucleophilic C end attacks to give propanenitrile.
(C)
Concepts used: ambident nucleophile
Every past question tagged to the same part of the syllabus, with solutions.
All JEE Main questions on Amines and Nitrogen Compounds · All JEE Main questions on Haloalkanes and Haloarenes
Past questions on the same topic (Cyanides and isocyanides), each with a worked solution.
Timed, in the real format, and marked the moment you submit.