Intro to C#
Lesson 1 / 18
Pito
What is C#? Your first program
The language of games, apps and servers
Chapter 1. Basics
10 minutes
Video
3 questions
C# ("C sharp") is a powerful, well-structured language made by Microsoft. It is used for: - 🎮 Games — the Unity engine runs on C# (thousands of popular games) - 🖥️ Windows apps, 🌐 web servers (ASP.NET), 📱 mobile apps (.NET MAUI)
The smallest program:
Console.WriteLine("Hello, world!");
// Output: Hello, world!
Console.WriteLine writes one line to the console. Every statement ends with ;.
Variables — with types
C# is strongly typed: a variable's type is stated up front and never changes.
string name = "Aziz";
int age = 14;
double height = 1.62;
bool student = true;
Console.WriteLine($"{name} is {age}");
// Output: Aziz is 14
$"...{...}" puts values inside text (interpolation).
💡 You don't need to install anything to try it: paste the code into dotnetfiddle.net and press Run.
Common mistakes
int age = "14";— you can't put text into a number → compile error.- Forgetting
;gives a; expectederror.
📚 Free resources
- Microsoft Learn — C# path — official free lessons
- freeCodeCamp × Microsoft: Foundational C# certification — a free certificate
- .NET Fiddle — run C# in the browser with no install