To find the length of the diagonal of the rectangular prism, we use the formula for the diagonal \(d\) of a rectangular prism, given by:
\[ d = \sqrt{l^2 + w^2 + h^2} \]
where:
- \(l\) is the length,
- \(w\) is the width, and
- \(h\) is the height of the prism.
From the problem statement, we have:
- The height \(h = 12\) cm,
- The width \(w = 3\) cm,
- The length \(l = 4\) cm.
Now, we can plug these values into the formula for the diagonal:
\[ d = \sqrt{(4)^2 + (3)^2 + (12)^2} \]
Calculating each term inside the square root:
\[ d = \sqrt{16 + 9 + 144} \]
Now adding these values together:
\[ d = \sqrt{169} \]
Finally, taking the square root:
\[ d = 13 , \text{cm} \]
Therefore, the length of the diagonal of the prism is \( \boxed{13} \) centimeters.