The formula with 40 substituted
km/L = 40 × 0.425144 = 17.01
The constant is an exact definition, not a rounded factor: the mile is 1.609344 km, the US gallon is 3.785411784 litres and the imperial gallon is 4.54609 litres. The MPG to km/L Converter explains where each comes from and gives a longer table.
The same 40 mpg (US) is 48.04 mpg on the imperial gallon, 5.88 L/100km and 17.01 km/L. If your 40 mpg figure came from a British source it already uses the imperial gallon, and the metric answer is 14.16 km/L instead.
What 40 mpg (US) means in practice
40 mpg (US) is 17.01 km/L, a mild-hybrid or very efficient small petrol figure. Indian hatchbacks are certified at around 20 kmpl on the ARAI cycle, and this is roughly what they return in owners' hands.