Thank you, so I was just using the wrong format flag. I am also using a signed variable, thanks. Problem solved. Now to figure out this Euler problem...