If you see the diagram points A, B, C are on the X, Y, Z axis respectively.
Point M is on the X-Y plane hence Coordinate of Z is zero.
Point N is on the Y-Z plane hence coordinate of X is zero.
Point L is on the X-Z plane hence coordinate of Y is zero.
Point P is in the space hence coordinate of X, Y, Z is a as it is a cube.
The cube has always four diagonals. Direction ratios of the diagonals are calculated as
M (a, a, 0) and C (0, 0, a)
MC (0 - a, 0 - a, a - 0)
MC (- a, - a, a)
i.e. (- 1, - 1, 1)
Similarly for other diagonals.
Magnitude of a vector is √3.