To create the intermediate code you will need to compile your program.
You can then use ildasm.exe (comes shipped with VS) to examine the resulting dll or exe
(can be found in e.g. C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ildasm.exe)
See this link for further details
http://msdn.microsoft.com/en-us/library/f7dy01k1.aspx[
^]
[Edit]
From your repost question I gather you want to write a program to parse your code and convert it into IL. Compiler theory is a bit of a large subject to cover here - some research (e.g. via Google) on compilers and parsers will point you in the right direction. You may find the c# language specfication useful as well as the CLI specification. You should also study simple programs using ildasm.exe and use it to generate expected test results for your program.
Warning - Given the simplicity of the sample program you provided (which as richcb points out won't even compile) I suspect compiler writing may be a bridge too far for you at the moment.
If this was not your intention then use the Improve Question link to add further detail to your question and post a reply to this solution - the latter action will generate a message for me to return here.