Take into account that the slope of a line is given by the following formula:

where (x1,y1) and (x2,y2) are two points on the line.
In this case:
(x1,y1) = (p,3)
(x2,y2) = (6,p)
By replacing the previous values into the formula for m, we get:

Now, by making m = 2 and solving for p, we obtain:

Hence, the value of p is p = 5