# How to define character constants in C#?

CsharpProgrammingServer Side Programming

Character literals are enclosed in single quotes. For example, 'x' and can be stored in a simple variable of char type. A character literal can be a plain character (such as 'x'), an escape sequence (such as '\t'), or a universal character (such as '\u02C0').

Let us see an example how to define a character constant in C# −

using System;

namespace Demo {
class Program {
static void Main(string[] args) {
Console.WriteLine("Welcome!\t\n\n");
Console.WriteLine("This is it!");
}
Console.WriteLine("Welcome!\t\n\n");
Console.WriteLine("This is it!");