Let the distance to the destination be \( D \) km.
Step 1: Time difference.
Time taken at 3 km/hr = \( \frac{D}{3} \) hours
Time taken at 4 km/hr = \( \frac{D}{4} \) hours
The difference in time = \( 40 + 30 = 70 \) minutes = \( \frac{7}{6} \) hours.
So,
\[
\frac{D}{3} - \frac{D}{4} = \frac{7}{6}
\]
Step 2: Solving the equation.
Take LCM of 3 and 4:
\[
\frac{4D - 3D}{12} = \frac{7}{6} \quad \Rightarrow \quad \frac{D}{12} = \frac{7}{6}
\]
\[
D = \frac{7}{6} \times 12 = 14 \, \text{km}
\]
Thus, the distance is \( \boxed{14} \, \text{km.}\)