When two dice are thrown, there are a total of \( 6 \times 6 = 36 \) possible outcomes.
- The sum of 7 can be obtained in the following combinations: (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1) — 6 outcomes.
- The sum of 8 can be obtained in the following combinations: (2, 6), (3, 5), (4, 4), (5, 3), (6, 2) — 5 outcomes.
Thus, the total number of outcomes where the sum is 7 or 8 is \( 6 + 5 = 11 \).
The probability that the sum is neither 7 nor 8 is:
\[
\frac{36 - 11}{36} = \frac{25}{36}
\]
Therefore, the correct answer is 4. \( \frac{25}{36} \).