It is about :
Length of line segment in the rectangular coordinate system

If a segment is horizontal, its length is the difference between its x coordinates. If the result is negative, you need to consider the absolute value (or just pick the coordinates in the correct order, i.e. the bigger minus the smaller).
So, we have
[tex]CD = D_x-C_x=6-1=5[/tex]
[tex]EF = F_x-E_x=-2-(-8)=-2+8=6[/tex]