Step 1: Find the total frequency.
\[
N=8+13+10+7+12=50.
\]
Hence,
\[
\frac{N}{2}=25.
\]
Step 2: Locate the median class.
The cumulative frequencies are
\[
\begin{array}{|c|c|}
\hline
\text{Class} & \text{Cumulative frequency}
\hline
10-20 & 8
20-30 & 21
30-40 & 31
40-50 & 38
50-60 & 50
\hline
\end{array}
\]
Since \(25\) lies in the class \(30-40\),
\[
l=30,\quad h=10,\quad f=10,\quad cf=21.
\]
Step 3: Apply the median formula.
\[
\text{Median}
=
l+\frac{\left(\frac{N}{2}-cf\right)}{f}\times h
\]
\[
=
30+\frac{25-21}{10}\times10
\]
\[
=30+4=34.
\]
Step 4: Final conclusion.
\[
\boxed{34}
\]
Hence, the correct option is \(\boxed{(C)}\).