What is the greatest possible product of any two distinct prime numbers less than 40?
We look for the two largest prime numbers less than 40 and find that they are 37 and 31. The product of these two numbers is $37\times31=\boxed{1147}$.