Locked lesson.
About this lesson
In this lesson, we learn how to capture User Input, assign it to a variable, and Output it to the screen.
Exercise files
Download this lesson’s related exercise files.
21 - User Input Output.docx61.2 KB 21 - User Input Output SOLUTION.docx
58.4 KB
Quick reference
User Input / Output
Gettting user input is very easy with C#.
When to use
Use this whenever you need to get user input in your program.
Instructions
Console.WriteLine("What Is Your Name?");
string name = Console.ReadLine();
Console.WriteLine("Hello " + name);
Hints & tips
- Console.ReadLine();
Lesson notes are only available for subscribers.