Code Hunt

Programming with C# – Lesson 02


Before to write your first C# program below points are worth to note

  1. C# is Case Sensitive.
  2. All statements and Expressions must end with a semicolon ( ; ).
  3. The program execution starts at the Main Method.
  4. Unlike JAVA, file name could be different from the class name.

Let’s develop First Hello World Application using visual studio console.

01. Open your Visual Studio. ( In here i am using VS 2013).

02. From Start page click on the “ New Project ” or Go to menu “ File > New > Project “. you will get the ” New Project Window “.

03. Select “Console Application” as displays on above image under ” Templates > Visual C# > Windows from the Left hand side bar. Select a proper location for your project and click on “OK” button.

Worth to note : When you are selecting a project name you can choose any name related to you Project. In here i have choose ” HelloWorld” as my project name. You have to consider about “Capitalization Rules“. There are rules we should follow when we are developing a software to meet Industry Standards. You can find read about Capitalization Rules from Microsoft MSDN. (click here).

04. Now you can start the writing your Hello World code in the program window. Once you wrote the complete program which i explained on ” Lesson 01 ” it will looks like below.

05. Now you can save the program and click on “ Start ” button or Menu ” Debug > Start Debugging ” to execute your first program.

06. Once your application executed you can see the output “ Hello World ! ” Print on a black screen like below.

07. Press ” any key ” to stop debugging the program. Now you can try writing small programs to display any thing as you wish.

In Next Lesson, I will explain How to Implement Classes. 

Related posts

Leave a Reply