last modified October 18, 2023
This is C# tutorial. In this tutorial you will learn the basics of the C# language.
C# is a modern, high-level, general-purpose, object-oriented programming language. It is the principal language of the .NET. It supports functional, procedural, generic, object-oriented, and component-oriented programming disciplines.
The design goals of the language were software robustness, durability and programmer productivity. It can be used to create console applications, GUI applications, web applications, both on PCs and embedded systems. C# was created by Microsoft corporation.
.NET is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. With .NET, we can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT.
$ dotnet --version 7.0.102
In order to work with .NET, we need to dowload and install .NET SDK. The .NET 7 supports C# 11.0.
Compiling C# programs
After installing .NET SDK, we can build our first C# program.
$ dotnet new console -o Simple
dotnet new console command, we create a new console
Console.WriteLine("This is C#");
This is a simple C# program that prints a message to the console.
$ dotnet run This is C#
We compile and run a simple C# program with
Visual Studio Code
It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring.
List all C# tutorials.