C# Tutorial

C# Variables

Variables

Variables store data values. C# provides clear rules for declaring and updating variables.

  • Declare variables using C# conventions
  • Choose meaningful names
string name = "Sturdee";
int year = 2026;
Console.WriteLine($"{name} {year}");
Try it Yourself
Run this CSHARP example in your local environment or course sandbox.