The correct option is D Three pairs thoracic and six pairs abdominal
There are total nine pairs of ganglia in cockroach. In the thorax, three pairs of thoracic ganglia control locomotion by innervating the legs and the wings. The six pairs of ganglia are present in the abdomen which control the movements of abdominal muscles.
Therefore, the correct answer is option B.