Guyz please help me

Ive got a practical exam tomorrow can anyone give a simple coding for implementing prims algorithm. It accepts the vertices and cost and gives out minimum spanning tree. Please guyz. It must be very simple. It need not be perfect. It need not work for all cases.

This isnt a HW help. I know the concept but its urgent.