If p+q and pq are known then quadratic equation corresponding to roots as p and q is given by,x2−(p+q)x+pq=0
⇒x2−2x−24=0, substitute the given values
⇒x2−6x+4x−24=0, split the middle term
⇒(x2−6x)+(4x−24)=0, group pair of terms
⇒x(x−6)+4(x−6)=0, factor each binomials
⇒(x−6)(x+4)=0, factor out common factor
⇒x=6 or x=−4, set each factor to 0
Hence p and q are 6 and −4