CSharp - Write program to Read user input via console window

Requirements

You will get some input from user in the console window.

Accepts a single line of text from the user and immediately repeats the inputted text to the output.

Hint

When you launch the program using the F5 key from Visual Studio, you will see an empty screen.

Enter a sentence and send it to the program using the Enter key.

Demo

using System;
using System.Globalization;

class Program/*ww  w  .  j  ava  2 s . com*/
{
    static void Main(string[] args)
    {
        // Reading single line of text (until user presses Enter key) 
        string input = Console.ReadLine();

        // Outputting the input 
        Console.WriteLine(input);
    }
}

Result

Modify the previous program to give the user a hint about what she is supposed to do.

Demo

using System;
using System.Globalization;

class Program// www .j a v a  2  s  .c  om
{
    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);

    }
}

Result

Notes

Console.Write does not transfer the cursor to the next line.

Console.WriteLine adds new line and moves the cursor to the next line.