added the test code in C