C codes

completed