WordPress automatically do formatting of codes which can surely become a huge problem for many blogger. But this can be disabled easily. Just follow this one step tutorial and you should be good.