C# Basics

Your first C# programs: how a C# project is built and run, how variables hold values, which data types C# offers and why the type matters, how to convert between types, and how to calculate with expressions.

Updated

C# Projects

  1. Your First C# Program (Novice): Write and run your first C# program, first as a single file with dotnet run, then as a project in the terminal and in Visual Studio.

Variables in C#

  1. What is a Variable (Novice): A variable is a named place where your program remembers a value, so it can use it again later.

C# Data Types

  1. C# Data Types (Novice): Every C# variable has a data type that decides what it can hold: whole numbers, decimals, money, single characters, text, or true and false.

Converting Data Types in C#

  1. Converting Data Types in C# (Apprentice): C# converts a smaller type to a larger one for you; anything else you convert yourself, with a cast, the Convert class, or Parse for text.

Arithmetic and Expressions in C#

  1. Arithmetic and Expressions in C# (Novice): Calculate in C# with + - * / and %, know why 5 / 4 is 1, and work out an expression in the order C# does.

Exercise: Variables and Data Types

  1. Exercise: Variables and Data Types (Novice): Solve 28 small problems with variables, data types and expressions, and check every answer with tests.