CSharp examples for Language Basics:Console
Reading single line of text (until user presses Enter key)
using System;// w w w .j a va2 s . co m using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Hinting user what we want from her Console.Write("Enter a sentence (and press Enter): "); // Reading line of text string input = Console.ReadLine(); // Repeating to the output Console.WriteLine("You have entered: " + input); } }