Write your first code using C# (Get started with C#, Part 1)
Microsoft Learn
The first part of Microsoft’s C# series for beginners, made of four modules of about 40 minutes each. You write and run the code in an editor in the browser, and the modules end with a challenge to solve on your own and a short quiz. It covers console input and output, variables and data types, arithmetic and if statements.
What you'll learn
- Printing to the console with Console.WriteLine and Console.Write
- Reading and fixing compiler errors
- Literals, variables and implicitly typed variables with var
- Arithmetic, compound assignment and increment operators
- Branching with if, else if and else