c# char input

42

c# char input -

// C# program to input a character
// using Convert.ToChar()

char ch;

//input character 
Console.Write("Enter a character: ");
ch = Convert.ToChar(Console.ReadLine());

//printing the input character
Console.WriteLine("Input character is {0}", ch);

c# char input -

input[i] = Console.ReadKey().KeyChar;

Comments

Submit
0 Comments