We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as hard as you think.
BTW: Do not re-post the same question because you didn't get an answer in the first three hours - it makes it less likely that you will get a useful answer, rather than more.
Requiring for c codings[
^]