C# User Input
Console.ReadLine reads a line of text as a string. Convert it if you need a number. The result may be null, so check it.
Example
string? name = Console.ReadLine();
Console.WriteLine("Hello " + (name ?? "stranger"));Exercise
Read a line.
Console.();
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.