Why has the A340 not been fitted with only three engines? The A340 was created because the airlines wanted an aircraft they could cross the atlantic ocean with (They couldn't with their twins because of ETOPS so far). So Airbus upgraded the A330 and added two engines. Because of the four engines, the plane was now allowed to cross the ocean.

However, four engines instead of two increase fuel cost dramatically (I assume). And the A340 is the same size as the A330. The A330 could fly with 2 engines. So why hasn't Airbus built the A340 with three engines instead of four. The fuel cost could have been reduced significantly without loosing the permission to cross the atlantic ocean. For example the MD-11 had three engines and also had permission to cross the ocean.
Because the third engine would need to be near on centerline. That means in the tail.

Putting the engine in the tail significantly changes its design requirements. 

Supporting an engine requires a lot of structural support. Then you need to run fuel to it. The effective height of the rudder is decreased. You probably need to switch over to a T-tail. The center of mass is also shifted which influences where the wings need to go.

In short, adding a single engine requires a redesign of the entire tail. While adding an engine to the wings is much simpler.