C# Hello World

C# is undoubtedly one of the easiest languages to get started in. In this brief tutorial we'll create a "Hello World" console application using Microsoft's free Visual C# express.

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

Once you've installed Visual C#, go to the File menu and select New Project. Chose Console Application for the project type. Change the name of the application in the text box at the bottom of the dialog to whatever you want, or just leave it at the default. Click OK.

You've now got a program that looks like the following. If you click the green arrow in the toolbar you can run it; nothing will happen except that a console will briefly appear.

In the following code, we've modified the application by adding just two lines.

The first line writes the text "Hello World". The second line waits for you to press a key. The reason the second line is necessary is that otherwise the console is liable to disappear before you can see what's written in it.