"Hello world" example.
Lets start with a very small console application and whom I am to brake the "Hello world" tradition.
Ok.
First step is you need to open a new project using Visual Studio 2005,2008 or 2010.
(click File from the menu bar at the top. From the File menu, select New Project and select Console Application. Then click OK.)
Ok.
First step is you need to open a new project using Visual Studio 2005,2008 or 2010.
(click File from the menu bar at the top. From the File menu, select New Project and select Console Application. Then click OK.)
using System;
class Program
{
static void Main()
{
}
}
Then you will see a segment of code like above.
Lets write our first line of code. Now place the cursor between the two curly brackets under
static void Main() and hit enter.
Then type the following line of code as same it is.
using System; class Program { static void Main() { Console.WriteLine("Hello world!");Console.ReadLine();} }
To actually see your line of text, click Debug > Start Without Debugging. You should now see this:
This total effect is to write the following text to the output console since we have used a console application in C#.
"Hello world!"
Lesson 02--> Home
No comments:
Post a Comment