How to write in Serial Monitor what I enter?

When you talk to the board with the serial monitor it sends characters, you need to parse these characters back into a number on the Arduino. The standard C atoi() function does this nicely. I think that needs an stdlib.h header file, but don't take my word for that. If you give that function a c-string (char array) of numerals it will spit out an integer. There are other flavors if you want something other than an int.

For small values (0-255) that would fit in a byte variable you can also send characters who's ASCII value is equal to the number you want. This takes some work with the Arduino serial monitor, but it is an option for some other terminals like Realterm. http://realterm.sourceforge.net/