Identify A and B in the following reaction sequence.

From the JEE Main 2024 · 31 Jan · Shift 2 paper. Try it, check your answer, then read the worked solution below.
Identify A and B in the following reaction sequence.

Try it yourself first, then check your working against this.
Worked solution
Bromine is weakly deactivating but ortho/para directing; with concentrated bromobenzene is nitrated exhaustively to 2-bromo-1,3,5-trinitrobenzene (A).
The three nitro groups make the C-Br bond susceptible to nucleophilic aromatic substitution: NaOH replaces Br by , and acidification with HCl gives 2,4,6-trinitrophenol, picric acid (B).
(B)
Concepts used: nitration of bromobenzene, nucleophilic aromatic substitution
Every past question tagged to the same part of the syllabus, with solutions.
All JEE Main questions on Haloalkanes and Haloarenes · All JEE Main questions on Hydrocarbons · All JEE Main questions on Alcohols, Phenols and Ethers
Past questions on the same topic (Haloarenes), each with a worked solution.
Timed, in the real format, and marked the moment you submit.