How to read a string entered using the keyboard
class MainClass
{
public static void Main()
{
System.Console.Write("Enter a string: ");
string myString = System.Console.ReadLine();
System.Console.WriteLine("You entered " + myString);
}
}
Output Enter a string: qwert
You entered qwert
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
|