Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# How to read users input and display it

// Reading users Input

            // Here the code will save the input of the user, To the variable (Input)
            string input = Console.ReadLine();

            // And heres how we Display the saved input
            Console.WriteLine(input);
            // or
            Console.WriteLine("Some Text {0}", input);


            // Example where it could be used
            Console.WriteLine("Type in your name please!");

            string nameInput = Console.ReadLine();

            Console.WriteLine("Welcome {0}!", nameInput);
Comment

C# Getting User Input

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

PREVIOUS NEXT
Code Example
Csharp :: remove comma from string c# 
Csharp :: dotnet new project 
Csharp :: how to redirect to extern page in .net core 
Csharp :: clear controls from panel c# 
Csharp :: header export excel data only php 
Csharp :: c# first item i list 
Csharp :: make a list c# 
Csharp :: unity how to get the side ways velocity of a object 
Csharp :: Open another form with C# Winforms 
Csharp :: two variable in one loop in one line c# 
Csharp :: asp.net core 3.1 ajax partial view 
Csharp :: send type as argument c# 
Csharp :: how to write int array to console c# 
Csharp :: create line in unity 
Csharp :: disable rigidbody unity 
Csharp :: c# String.Concat() 
Csharp :: c# onmousedown. unity 
Csharp :: scenemanager.loadscene 
Csharp :: read all lines from txt c# 
Csharp :: c# sum of list 
Csharp :: c# date format 
Csharp :: parse datetime c# 
Csharp :: c# find substring in string 
Csharp :: c# how to fill a datatable 
Csharp :: database update dotnet 
Csharp :: c# concatenation 
Csharp :: c# round double 
Csharp :: create new .net project 
Csharp :: instantiate a player in photon 
Csharp :: array in c# stack overflow 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =