Finding the order of sorting of an array
The cleanest would be an enum and a switch (current) with three cases:

In each case you can then check if you stay in the current_order or if you 
switch to another or if you can return 0/1/-1.

Simplified:

current=NONE;
for()
    a=... b= ..
    switch(current)
        case NONE: if (a&gt;b) current=DEC; else if (a&lt;b) current=INC; break;
        case INC:  if (a&gt;b) return NONE; break;
        case DEC:  if (a&lt;b) return NONE; break;
return current;


I don't know if it's the right term, but I think that is a finite state machine. You could read about those to get more information; it's always good to use for parsing stuff.



From the comments:


  What should be returned if the array is one element long?


Good point. I would introduce another return value MIXED:

current=NONE;
for()
    a=... b= ..
    switch(current)
        case NONE: if (a&gt;b) current=DEC; else if (a&lt;b) current=INC; break;
        case INC:  if (a&gt;b) return MIXED; break;
        case DEC:  if (a&lt;b) return MIXED; break;
return current;