C# series 1.5 : First C# Program - ponda

Breaking

6/11/2017

C# series 1.5 : First C# Program

You can run, save, and share your C# codes on our Code Playground, without installing any additional software. Reference this lesson if you need to install the software on your computer. To create a C# program, you need to install an integrated development environment (IDE) with coding and debugging tools.

We will be using Visual Studio Community Edition, which is available to download for free. After installing it, choose the default configuration.

Next, click File - New - Project and then choose Console Application as shown below :


Console application uses a text only interface. We chose this type of application to fokus on learning the fundamental of C#.

Your First C# Program

Visual studio will automatically generate some code for your project :



You will learn what each of the statements does in the upcoming lessons. For now, remember that every c# console application must contain a method ( a function ) named Main. Main is the starting point of every application, i.e. the point where our program starts execution from. We will learn about classes, methods, arguments, and namespaces in the upcoming lessons.

Your First C# Program

To run your program, press Ctrl + F5. You will see the following screen :


This is a console window. As we did not have any statements in our main method, the program just produces a general message. Pressing any key will close the console.

Next : C# series 1.6 : Displaying Output

No comments:

Post a Comment