Answer:
The two numbers are 18 and 24.
Explanation:
Let x and y be the two numbers.
One of them (let's say y) is six less than the other. In other words:

Together, their sum is 42. Hence, we can write the equation:

Solve for x. Substitute:

Combine like terms:

Add:

And divide. Hence:

y is given by (x - 6). Hence:

In conclusion, the two numbers are 18 and 24.