Use below sample code for showing codes using code and pre HTML tag.
Pre Tag
<pre>
Put your codes here
</pre>
Code Tag
<code>
Put your codes here
</code>
Important
When creating page, make sure you select Full HTML as Text format.