A solution of a salt X reacts with AgNO3 solution to give white precipitate which…