DR and DS are the tangents from point D and OS and OR are the radius of circle.

∴ AD ⊥ OS and DR ⊥ OR
AD ⊥ CD (given)
In quadrilateral DROS
∠D + ∠R + ∠O + ∠S = 360°
⇒ 90° + 90° + ∠O + 90° = 360°
⇒ ∠O = 360° – 270° = 90°
Similarly in quadrilateral DROS
∠D = ∠R = ∠O = ∠S = 90°
and OS = OR [radii of a circle
So, DROS is a square
So, SD = DR = 10 cm (Tangents on circle from point D.)
∵ Tangents BP and BQ on circle from point B.
∴ BP = BQ = 27 cm
CQ = BC – BQ
⇒ CQ = 38 – 27 = 11 cm
∵ CR and EQ are the tangents of circle from point C.
∴ CR = CQ
⇒ CR = 11 cm
Now CD = CR + DR
⇒ CD = 11 + 10
⇒ CD = 21 cm