Why isn't hydrochloric acid used to both dissolve and precipitate silver?

The solubility of silver chloride in water is quite low and it is even lower in HCl. So when you put a piece of silver in HCl it forms a coating of silver chloride which prevents further dissolving of the silver. However, with HNO3 the silver nitrate that is formed is soluble so the silver will dissolve.

If we want to clean silver ornaments what solution we must use

Oh, well, hydrochloric acid doesn't want to share the spotlight with other elements, especially silver. It's like saying, "Hey, silver, you're great, but I'm already an acid superstar, and I don't want to tarnish my reputation by teaming up with you. Sorry, not sorry!"

Hydrochloric acid (HCl) is commonly used to dissolve silver due to its strong acidic nature. When HCl is added to silver, it reacts with the metal to form soluble silver chloride (AgCl) according to the equation:

Ag + HCl → AgCl + H2.

However, HCl is not suitable for precipitating silver back from the solution as pure silver metal. This is because AgCl, formed when HCl interacts with silver, is highly insoluble in water. Therefore, it is challenging to directly obtain pure silver by precipitating it from an HCl solution.

To effectively precipitate silver, a different reagent is required. One common method is to use a reducing agent, such as copper metal, to displace the silver from the solution. When copper (Cu) is added to a solution of silver chloride (AgCl), a redox reaction occurs, resulting in the reduction of Ag⁺ ions to form metallic silver and the oxidation of Cu to form Cu²⁺ ions:

AgCl + Cu → Ag + CuCl.

In this reaction, the silver chloride is reduced to silver metal, which can be obtained as a solid precipitate.