Menu
CoddyTech

Char

Part of the Fundamentals section of Coddy's C# journey. Lesson 6 of 70.

A char is a single character (For example: 1, 6, %, b, p, ., T, etc.)

To initialize a char value in a variable, enclose it within single quotation marks:

char c1 = 'h';

In the above example, a char variable named c1 is initialized.

challenge icon

Challenge

Beginner

Store the char B in a variable named initial.

Try it yourself

        // Type your code below
        // Replace the placeholder letter with the one the task asks for
        char initial = 'A';
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: Online C# compiler