spiral.c: Code not working