In the rectangular parallelepiped in the figure, the lengths of the segments $EH$, $HG$, and $EG$ are consecutive integers. The height of the parallelepiped is $12$. Find the volume of the parallelepiped.
[img]https://cdn.artofproblemsolving.com/attachments/6/4/f74e7fed38c815bff5539613f76b0c4ca9171b.png[/img]
1. We start by noting that $\triangle EHG$ is a right triangle. The lengths of the segments $EH$, $HG$, and $EG$ are consecutive integers. Since $EG$ is the hypotenuse, we can use the Pythagorean theorem to find the relationship between these sides.
   
2. Let the lengths of $EH$, $HG$, and $EG$ be $a$, $a+1$, and $a+2$ respectively. According to the Pythagorean theorem:
   \[
   EH^2 + HG^2 = EG^2
   \]
   Substituting the values, we get:
   \[
   a^2 + (a+1)^2 = (a+2)^2
   \]

3. Expanding and simplifying the equation:
   \[
   a^2 + (a^2 + 2a + 1) = (a^2 + 4a + 4)
   \]
   \[
   2a^2 + 2a + 1 = a^2 + 4a + 4
   \]
   \[
   2a^2 + 2a + 1 - a^2 - 4a - 4 = 0
   \]
   \[
   a^2 - 2a - 3 = 0
   \]

4. Solving the quadratic equation $a^2 - 2a - 3 = 0$ using the quadratic formula $a = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$:
   \[
   a = \frac{2 \pm \sqrt{4 + 12}}{2}
   \]
   \[
   a = \frac{2 \pm \sqrt{16}}{2}
   \]
   \[
   a = \frac{2 \pm 4}{2}
   \]
   \[
   a = 3 \quad \text{or} \quad a = -1
   \]
   Since $a$ must be a positive integer, we have $a = 3$.

5. Therefore, the lengths of the segments are:
   \[
   EH = 3, \quad HG = 4, \quad EG = 5
   \]

6. The dimensions of the base of the parallelepiped are $3$ and $4$, and the height is given as $12$. The volume $V$ of the parallelepiped is calculated as:
   \[
   V = \text{length} \times \text{width} \times \text{height}
   \]
   \[
   V = 3 \times 4 \times 12
   \]
   \[
   V = 144
   \]

The final answer is $\boxed{144}$.