In which blood vessels does the exchange of gases take place?

A. Arteries

B. Capillaries

C. Diaphragm

D. Veins