Console.Write("Enter your name:");
string name = Console.ReadLine();
Console.Write("Enter your age:");
string age = Console.ReadLine();
Console.WriteLine("Hello" + name + " you are " + age);
Console.ReadLine();
Console.Write("words");
input = Console.ReadLine();
using System;
namespace Sample
{
class Test
{
public static void Main(string[] args)
{
string testString;
Console.Write("Enter a string - ");
testString = Console.ReadLine();
Console.WriteLine("You entered '{0}'", testString);
}
}
}
// Type your username and press enter
Console.Write("Type your username: ");
// Create a string variable and get user input from the keyboard and store it in the variable
String name = Console.ReadLine();
// Print the value of the variable (userName), which will display the input value
Console.WriteLine(name);
// or try this
// Type your username and press enter
Console.Write("Type your username: ");
//Prints the username
Console.WriteLine(Console.ReadLine());
// Type your username and press enter
Console.Write("Type your username: ");
// Create a string variable and get user input from the keyboard and store it in the variable
String name = Console.ReadLine();
// Print the value of the variable (userName), which will display the input value
Console.WriteLine(name);
// or try this
// Type your username and press enter
Console.Write("Type your username: ");
//Prints the username
Console.WriteLine(Console.ReadLine());