The slope of a line parallel to X-axis is
The slope of a line passing through points (x1,y1) and (x2,y2) is y2−y1x2−x1.
Given the line is parallel to X-axis.
⟹ the points on the line has the same ordinate. I.e. y1=y2
Therefore, y2−y1=0.
I.e. the numerator of the expression y2−y1x2−x1 is zero. Hence the slope of a line parallel to X-axis is zero.