Step 1: Understanding the Concept
The product depends on which reagent is in excess.
Step 2: Reaction
With excess ammonia: \(8\text{NH}_3+3\text{Cl}_2\rightarrow 6\text{NH}_4\text{Cl}+\text{N}_2\).
With excess chlorine: \(\text{NH}_3+3\text{Cl}_2\rightarrow \text{NCl}_3+3\text{HCl}\).
Step 3: Compare the options
Excess chlorine gives nitrogen trichloride and hydrochloric acid, the fourth option.
Final Answer:
Excess chlorine gives nitrogen trichloride and hydrochloric acid.
\[ \boxed{\text{(D) }\text{Nitrogen trichloride and hydrochloric acid}} \]