Basic Programming with C#

console application projects

On this part, we will learn how to write a program from scratch. To write a program we need to know where the position for first time to write the program, and then learn the writing sequence program. The order of writing the program are as follows:

First create a project with Console application project see the main picture above.  And then write code inside main() like picture below, write your code beetwen { and } on static void Main(strting[] args).

First Program Console

1. Variable Declaration
The first stage in making the program is to tell the computer that will be used along with variable and data types. Each line program always ends a semicolon (semicolon) “;” if you create program with C Language.

For example:


2. Set variable with a value (Fill the variable that we declare before with a value)
After the declaration, the next step is to fill a value into a variable. Entered value must match the data type is declared. as in the example below:


3. Processing Variables
In the processing variables can be interpreted to perform mathematical calculations, equations other, print data to screen, etc.
In this process, the variables are processed (operated) must have passed the stage before with declaration and have value, if the first and second phases have not done it will display an error (the error).

Once the code is written in the correct order, then you can compile / execute the program by using the Command Line Interface Hold down CTRL + F5, so the windows command did not immediately shut down. To be able to follow and practice this tutorial, please watch the following youtube video tutorial.

Leave a Reply