Explanations:- If a reaction looks like, [tex]AB+CD\rightarrow AD+CB[/tex] then it is called double displacement reaction as two ions are exchanged in this reaction.
When sodium iodide and silver nitrate are added then a double displacement reaction takes place where iodide ion goes from sodium to solver and nitrate ion from silver to sodium. A precipitate of silver iodide forms in this reaction.
[tex]NaI(aq)+AgNO_3(aq)\rightarrow NaNO_3(aq)+AgI(s)[/tex]