char letter;
letter = 'a';
letter = Convert.ToChar(Console.ReadLine());
/*---------------------------*/
/* C# Example #29: */
/* example29.cs */
/* */
/* "char" data type */
/* */
/* Intro to C#, */
/* Nacho Cabanes */
/*---------------------------*/
using System;
public class Example29
{
public static void Main()
{
char letter;
letter = 'a';
Console.WriteLine("The letter is {0}", letter);
Console.WriteLine("Enter a new letter");
letter = Convert.ToChar(Console.ReadLine());
Console.WriteLine("Now the letter is {0}", letter);
}
}
No comments:
Post a Comment