line 299 and 335 in void turn(char input) - just use return, return NULL implies the function is going to return a value, when it does not.

line 376 and 377 - direction[1] is never initialized (you should at least put it to 0 at the start of the function) and direction[0] may not be initialized (same as previous).

line 454 and 455 - iter is used as an int, it should be an int.  it's also never initialized.  Use a for loop instead of a while for counting.  with -std=c99 you can do:
  for(int iter = 0; iter < 100; iter++) { x = x / 2 + n / (2 * x); }

i will also suggest looking into switch statements instead of if/else if statements.  it can make the code cleaner and easier to read.