Solutions for C section 7 lesson 9

Does anyone have a solution for this section 7 of lesson 9 in C?