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
pre
tags, and set the language of your code block with the
lang
attribute.
For example:
<pre lang="C#">
// your code
</pre>