To find the height \( h \) of the cylindrical grain bin, we can use the formula for the volume \( V \) of a cylinder:
\[ V = \pi r^2 h \]
where:
- \( V \) is the volume,
- \( r \) is the radius,
- \( h \) is the height,
- \( \pi \) is approximately 3.14.
Given:
- The volume \( V = 31,400 \) cubic feet,
- The diameter \( d = 40 \) feet.
First, we need to find the radius \( r \):
\[ r = \frac{d}{2} = \frac{40 \text{ ft}}{2} = 20 \text{ ft} \]
Now, we can plug the values into the volume formula and solve for \( h \):
\[ 31,400 = 3.14 \times (20)^2 \times h \]
Calculating \( (20)^2 \):
\[ (20)^2 = 400 \]
Now substitute this value into the volume formula:
\[ 31,400 = 3.14 \times 400 \times h \]
Calculating \( 3.14 \times 400 \):
\[ 3.14 \times 400 = 1256 \]
Now we have:
\[ 31,400 = 1256 \times h \]
To find \( h \), divide both sides by 1256:
\[ h = \frac{31,400}{1256} \]
Calculating \( h \):
\[ h \approx 25 \]
Thus, the height \( h \) of the grain bin is approximately \( 25 \) feet.
\[ \boxed{25} \text{ ft} \]