Answer:
Kim gave her friend 6 pencils
Explanation:
If Kim had 13 pencils to start of with, then gives her friend some, gets two more and ends up with 9 that means she gave her friend 6 pencils. Since she got two more, that put her at 9, meaning she must have had 7 before then, meaning she gave her friend 6 pencils.
I hope that makes sense :)