Das ist wegen der darstellung von negativen. Du mußt voher das Vorzeichen abfragen
Code:
if ( x < 0)  
{
     printf  "-";   // minus an den output string vor oder hinten
     x *= -1;      // in plus Zahl       umwandeln
}
jetzt gehts wieder normal weiter