Illustrates how to read a character entered using the keyboard : Console Input Output : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Console Input Output »

 

Illustrates how to read a character entered using the keyboard









    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

/*
  Example2_13.cs illustrates how to read
  a character entered using the keyboard
*/

public class Example2_131
{

  public static void Main()
  {

    System.Console.Write("Enter a character: ");
    char myChar = (char) System.Console.Read();
    System.Console.WriteLine("You entered " + myChar);

  }

}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Console Input Output