To format code as a code block, and if you use the WYSIWYG editor, then choose "Formatted" in the left drop down, and set the language of your code block with the second drop down.
If you're not using the WYSIWYG editor, but the HTML editor,
then write your code into
tags, and set the language of your code block with the
// your code