Skip to content
RapidFinger — free online typing test

Typing tests

← All programming languages

C# Coding Practice

Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.

Classes, collections, and loops

using System;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var names = new List<string> { "Ada", "Grace", "Linus" };

        foreach (string name in names)
        {
            if (name.Length > 4)
            {
                Console.WriteLine($"Hello, {name}!");
            }
        }
    }
}

Count values in a dictionary

using System;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var scores = new Dictionary<string, int>
        {
            ["Ada"] = 92,
            ["Linus"] = 85,
            ["Grace"] = 98
        };

        foreach (var entry in scores)
        {
            Console.WriteLine($"{entry.Key}: {entry.Value}");
        }
    }
}

Filter a list with LINQ

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] numbers = { 3, 8, 12, 5, 20 };

        var largeNumbers = numbers
            .Where(number => number >= 10)
            .ToArray();

        Console.WriteLine(string.Join(", ", largeNumbers));
    }
}