Added program to C-D exercise 2 and 3