C Programming Exercises, Solution