My First C# Program Using Notepad

Photo by Medium Rare on Unsplash

My First C# Program Using Notepad

Table of contents

C# Basic

STEP - 1 : Open Notepad and write below code init:

class First
{
    static void Main()
    {
        System.Concole.Clear();
        System.Concole.WriteLine("MY FIRST C# PROGRAM USING NOTEPAD. ");
    }
}

Step - 2: Saving the program.

Create a folder on any drive of your computer with the name “CSharp” and save the above file into that folder naming it as “First.cs".

Step 3: Compilation of the program.

We need to compile our C# program by using C# Compiler at “Developer Command Prompt ”, provided along with the Visual Studio software, and to do that go to Windows Search and search for “Developer Command Prompt for VS 2022”, click on it to open. Once it is open it will be pointing to the location where Visual Studio software is installed, so change to the location where you have created the folder and compile the program as below:

E.g.: D:\CSharp> csc First.cs

Once the program is compiled successfully it generates an output file with the name First.exethat contains “CIL (Common Intermediate Language) or MSIL (Microsoft Intermediate Language) Code” in it which we need to execute.

Step 4: Execution of the program.

Now at the same Command Prompt we can run our First file as below:

E.g.: D:\CSharp> First

Done