Practical C# learning

Start with C#.
Build with confidence.

Clear explanations, runnable examples and guided projects. Follow a structured path from your first console message to working with data and formatting results.

hello-world.cs
// Your first step starts here.
Console.WriteLine("Hello, developer!");
> Hello, developer!

Your learning path

Four focused modules. Start at the beginning or pick the skill you want to practise.

Explore the latest lessons

Practical exercises and explanations to keep your learning moving.

Posts

C# Challenge: Format English and Russian Console Output

  Complete the challenge Code challenges reinforce what you learned and build confidence. In this task, you’ll print clear instructions that tell users where your app writes data files. You’re not creating files yet—just formatting console output for approval. You’ll apply character escape sequences , verbatim strings , Unicode , and string interpolation to display instructions in both English and Russian. Challenge: Format and display instructions Start with the two required lines below. You must not change them, but you may add code above or below. Use only Console.WriteLine() or Console.Write() twice total ; any extra spacing or new lines must come from escape sequences, verbatim strings, or interpolation. string projectName = "ACME"; string russianMessage = "\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434"; Goal output Your code must produce exactly this: View English ou...

C# String Interpolation: Combine Text and Variables

  Exercise – Combine Strings Using String Interpolation While string concatenation is common and easy to use, string interpolation has become the preferred choice when building clear, readable, and compact formatted messages. Interpolation allows you to merge literal text and variable values using a clean template-style syntax. What is string interpolation? String interpolation lets you insert values into a literal string by using a template that contains { } expressions. Each expression evaluates to a value at runtime. To enable interpolation, prefix the string with the $ symbol. Before (concatenation): string message = greeting + " " + firstName + "!"; After (using interpolation): string message = $"{greeting} {firstName}!"; Interpolation reduces clutter and improves readability, especially when combining many values in a single formatted message. Use string interpolation to combine a literal string and a variable Clear any previous code, then enter:...

C# String Concatenation: Combine Text with the + Operator

  Exercise – Combine Strings Using String Concatenation In many applications, you'll often combine data from different sources—literal text, variables, and even numeric values. In this unit, you'll learn how C# uses string concatenation to merge multiple pieces of text into one meaningful string. What is string concatenation? String concatenation simply means combining two or more string values into a single string. Unlike numeric addition, concatenation appends one value to another in sequence. In this exercise, you’ll write C# code to join string values together. Concatenate a literal string and a variable To concatenate text, use the + operator. Replace any previous code in your editor, then enter: string firstName = "Bob"; string message = "Hello " + firstName; Console.WriteLine(message); Output: Hello Bob The literal string "Hello " appears first, and the value stored in firstName is appended immediately after it. Concatenate multiple vari...

C# Escape Sequences, Verbatim Strings and Unicode

Use escape sequences to control console layout, verbatim literals for paths, and Unicode escapes to include text from other writing systems. Newlines, tabs and quotation marks In a regular C# string, a backslash begins an escape sequence. These small examples can be run separately: Console.WriteLine("Hello\nWorld!"); Console.WriteLine("Hello\tWorld!"); Console.WriteLine("Hello \"World\"!"); The first call prints two lines. The second separates the words with a tab, whose width depends on the console. The last prints Hello "World"! . An unescaped quotation mark ends a regular string, so quotation marks that are part of the message must be escaped. Write Windows paths correctly Console.WriteLine("c:\\source\\repos"); Console.WriteLine(@"c:\source\repos"); Both statements display the same path. The regular string doubles each backslash; the verbatim string starts with @ and keeps each backslash literal. In a verbatim s...

C# String Formatting: Module 4 Introduction

Introduction As a developer, you’ll often combine and format literal and variable data in C# to produce a new value—ready to display, save to a file, or transmit over the network. The good news: C# offers several clear and efficient ways to compose and format text. Imagine you’re building a command‑line tool and need to show output that mixes fixed text, values stored in variables, numbers, and text from other languages. How do you format that output so users quickly understand your app’s message? In this module, you’ll use character escape sequences to embed special characters—such as tabs and line feeds—and even render characters from other writing systems like Kanji or Cyrillic . You’ll learn to combine strings using concatenation and create flexible templates using string interpolation . By the end, you’ll confidently control how textual data is presented to your application’s end users. Learning objectives In this module, you will: Create string data that includes tabs, new lin...

C# Student Grades: Format Console Output

Finish the student-grade report by adding a header and spacing the output into columns. This example uses newline and tab escape sequences. Newlines and tab stops \n inserts a newline inside a string. Console.WriteLine() also ends its output with a newline. \t advances to the next tab stop; its visible width depends on the terminal and the preceding text. Complete report program int currentAssignments = 5; int sophia1 = 93; int sophia2 = 87; int sophia3 = 98; int sophia4 = 95; int sophia5 = 100; int nicolas1 = 80; int nicolas2 = 83; int nicolas3 = 82; int nicolas4 = 88; int nicolas5 = 85; int zahirah1 = 84; int zahirah2 = 96; int zahirah3 = 73; int zahirah4 = 85; int zahirah5 = 79; int jeong1 = 90; int jeong2 = 92; int jeong3 = 98; int jeong4 = 100; int jeong5 = 97; int sophiaSum = sophia1 + sophia2 + sophia3 + sophia4 + sophia5; int nicolasSum = nicolas1 + nicolas2 + nicolas3 + nicolas4 + nicolas5; int zahirahSum = zahirah1 + zahirah2 + zahirah3 + zahirah4 + zahirah5; int jeon...