How to read a character entered using the keyboard
class MainClass
{
public static void Main()
{
System.Console.Write("Enter a character: ");
char myChar = (char) System.Console.Read();
System.Console.WriteLine("You entered " + myChar);
}
}
Output Enter a character: q
You entered
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
|