C# Keyboard Input (Beginner Help)
- by ThickBook
I am trying to ask user "enter any key and when that key is pressed it shows that "You Pressed "Key". Can you help what's wrong in this code?
This is what I have written
using System;
class Program
{
public static void Main(string[] args)
{
Console.Write("Enter any Key: ");
char name = Console.Read();
Console.WriteLine("You pressed {0}", name);
}
}