while compare, something is wrong
Nick Gammon correctly points out a problem due to an extra semicolon, but you should also note what the construct else(s &lt; n) is doing.  When the if condition that this else gives an alternative to is false, the statement   (s &lt; n) gets executed.  That statement is an expression statement, and its value is the evaluation of s&lt;n, either true or false.  

If the semicolon after (s &lt; n) weren't there, you'd get a compile error because (s &lt; n) serial.println("north") is not a valid statement.  You may have meant to say else if(s &lt; n) instead of else(s &lt; n).

Note, in the sequence

if (e &gt; w)
   Serial.println("west");
else if (e &lt; w)
   Serial.println("east");
else if (s &gt; n)
   ...


that last else typically is reached only rarely, because the only condition to get to it is e and w being equal.  Due to sensor noise and signal processing noise, the chance of e and w being equal is probably at most a few percent.

If your north/south test sequence is supposed to be independent of your east/west test sequence, leave out the second if and second else .  That is, instead say:

if (e &gt; w)
   Serial.println("west");
else
   Serial.println("east");
if (s &gt; n)
   ...