I have entered a formula for calculating distance between 2 points in a 3D space in a math expression node, but there is no output pin.

It’s a case of RTFM I’m afraid:

^ is a logical operator:

or

sqrt(square(x1-x2)+square(y1-y2)+square(z1-z2))

which, when you feed it in, gets correct to: