Ping Script

hello, I am looking to make a script that will ping a remote ip address. Upon completion of the ping I want the program to either ping again if the # of packets transmitted is equal to the number of packets received or exit if the two values are unequal and information was lost. I am not sure if I should go about this program with a shell script or a C script or any other alternative. In either case would someone be able to point me in the correct direction?

Aside from using ip traffic for not much return, what are you attempting?
Making sure that a node is up?

I'll bet if you explain what you want to acheive, some here already knows how to do it, rather than helping you do something that seems unusual.

why is that for a successful ping you want to re-instantiate the ping on the remote-ip again???
if that was a unsuccessful receive for the ICMP packets delivered i could see some point in pinging again !!!

That's why I asked for 'what' the OP is trying to accomplish, not how he wants to do it.