Taking Input From User In C#




Taking Values from User


The Console class in the System namespace provides a function ReadLine() for accepting input
from the user and store it into a variable.

For example,

using System;
namespace HelloWorldApp
{
class Program
{
static void Main(string[] args)
{
string name;
Console.Write("Please enter your name");
name = Console.ReadLine();
Console.WriteLine(name);
Console.ReadLine();
}
}
}

إرسال تعليق

أحدث أقدم