Use code tags given beside.
Select code you want to put in purple color and than click on "<>".
Than when you submit you answer/question it will come into purple color.
code tags. it is the first (ie: top right selection) under Format: found on the righ hand side of your comment box. Highlight the code then press that button. You can also type it in. There is a start and end tag as shown below (without the space before the closing braces ] so that u can see it.