Post Top Ad

Asp.Net Core Mvc

Blazor

Post Top Ad




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();
}
}
}

No comments:

Post a Comment

Post Top Ad