Step 1: Concept
Nitrite ion ($NO_2^-$) is an ambident nucleophile; it can bond through $O$ or $N$.
Step 2: Analysis
- $KNO_2$ is ionic, and the $O$ atom (carrying the negative charge) attacks to form an alkyl nitrite ($R-O-N=O$).
- $AgNO_2$ is covalent. The lone pair on Nitrogen is the primary nucleophilic site, leading to the formation of a nitroalkane ($R-NO_2$).
Step 3: Conclusion
Silver nitrite ($AgNO_2$) is used to prepare nitroalkanes.
Final Answer: (D)