because when p1 calls p2, p2 has not been decleared yet, so it doesn't know about it (procedural programming and all that).
You can rearrange the order of procedures, but sometimes you might get loops. There's a forward keyword and function prototyping that solves that problem.