Home Introduction to C# (For DSA)
Post
Cancel

Introduction to C# (For DSA)

Introduction

C# is an Object Oriented Programming language and it has many similarities to Java, C++ and VB. In fact, C# combines the power and efficiency of C++, the simple and clean object oriented design of Java and the language simplification of Visual Basic.

Writing Your First Hello World Program in C#

We can use any Text Editor for writting a C# program. We will use Visual Studio Code for this course.

Open Visual Studio Code. Create a new file and name it as Program.cs. Write below Code and save the file.

1
2
3
4
5
6
7
class Program
{
    public static void Main(string[] args)
    {
        System.Console.WriteLine("Hello World!");
    }
}

To compile this file, open terminal from VS Code menu. Alternatively, open command prompt in Windows or Terminal in Mac. Now, run below command:

1
csc Program.cs
This post is licensed under CC BY 4.0 by the author.