Implemented prog_test in c