Take the example programs and convert them into functions needed to do each part of the program you are to build.

Functions in C - Cprogramming.com

Tim S.