ex4.c C source code