Presence of electron withdrawing group like −F,−Cl (−F is more electron withdrawing) increases the acidity of carboxylic acids by decreasing electron density on the oxygen atom of O−H bond. Due to it the O−H bond becomes weaker and proton is released easily.
Phenyl group (−C6H5) is also an electron withdrawing group. But it decreases the acidity of - COOH group when attached to the chain. This is because of +R effect which tends to destabilise the ion.
Thus, the order of acidity is (B)CF3COOH>(A)CCl3COOH>(D)HCOOH>(C)C6H5COOH