An electron attracting group i.e -I effect group is present in benzoic acid while electron releasing group i.e +I effect group is present in acetic acid.
-I effect group increases the acedic strenght of an acid.
+I effect decreases the acidic strenth of an acid .
And Formic acid is stronger than acetic acid
An electron releasing group i.e+I effect is present in acetic acid whereas no such releasing group is present in formic acid and as we have seen +I effect decreases acidic strenght of an acid .
Therefore C6H5COOH(benzoic acid) is stronger than acetic acid(CH3COOH) .