o‘zing o‘rgan
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 ; expected error.

📚 Free resources

Video lesson

Check yourself

Question 1 / 3

Which language does the Unity game engine use?

Choices

Question 2 / 3

Which type is used for a whole number?

Choices

Question 3 / 3

What does "strongly typed" mean?

Choices