TL:DR 80 Kph
This question is best answered using the idea of relative motion. If we were to choose a point between the two cars, say for example, the point where they would collide, one car would be going 40 Kph in the positive direction, which we would just denote as 40 Kph, and the other is going 40 Kph in the negative direction, which we would denote as -40 Kph.
So if we now move to the reference point of one of the cars. We'll call this Car A, and the other one Car B. From the perspective of Car A, the point of collision is moving towards it at 40 Kph. We know that Car B is moving at 40 Kph with respect to the point of collision, so its movement with respect to Car A is the speed of the point of collision (40 Kph), plus Car B's movement with respect to the point of collision (40 Kph). So Car B is moving at 80 Kph, with respect to Car A. This will be the impact speed of the two cars.
Although this problem can be solved somewhat easily by just saying "Well, they are moving towards each other, so just add the speeds", most problems won't be that easy. Its usually best to choose a separate point of reference, find the speeds with respect to that point, and then move that point to one of the objects in question. Also make sure that you are keeping track of signs, as not all problems will have their speeds adding up so simply.