The previous responses will probably solve your problem, but in case they don't, here's something else to try.
It's possible that you're running with the
switch enabled, which will automatically print a newline character every time you print something. Check the top of the program for something like
, if it's there. And make sure whatever is calling your program isn't passing it the