mega 2560 programming serial comm quesiton

I've recently began work with an arduino mega 2560 (the one with the solid state chip). I've been trying to establish serial communication through it using this simple program in the 1.01 and r23 IDEs

void setup ()
void loop()
int val = -'0';


When I send values to the com port however, arduino sends back oct characters that do not correspond with the value I put in. I tried changing the baud rate to 115200, this only changed the oct characters put out. I then decreased the baud rate to 4800, and got an output that was closer to what I was looking for, however what is being sent to the com port is
for input values of "1" and "2"
Does anyone know what is causing this, or how to fix it?

-38 + '0' = 10 = \r

That is the new line character.

You can tell the Serial Monitor on the IDE to not send new line characters (drop down in the bottom right)

Thanks! when I switched to "no line ending" everything came out as expected