Create format.c

Added body of functions.