We are given that the two legs of the right triangle have lengths of $X$ inches and 42 inches.
The area of a right triangle can be found using the formula: Area = (1/2) * base * height.
In this case, the base of the triangle is $X$ inches and the height is 42 inches.
So, the area of the triangle is:
Area = (1/2) * $X$ * 42
We are given that the area is 840 square inches, so we can write:
840 = (1/2) * $X$ * 42
To find the value of $X$, we can solve this equation.
Multiplying both sides of the equation by 2 to eliminate the fraction, we get:
1680 = $X$ * 42
Dividing both sides of the equation by 42, we find:
$X$ = 40
The value of $X$ is 40.
The answer is: 40
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
In a particular right triangle, the two legs have lengths of X inches and 42 inches. What is the area of the triangle?
If we know the answer to the above question is 840, what is the value of unknown variable X?

### Answer:
