added ex3.c