C code

C code, compiles and works well in gcc.