added problem 2 in c - not working.