Answers for "how to give user input in c# in char"

C#
1

c# char input

// C# program to input a character
// using Convert.ToChar()

char ch;

//input character 
Console.Write("Enter a character: ");
ch = Convert.ToChar(Console.ReadLine());

//printing the input character
Console.WriteLine("Input character is {0}", ch);
Posted by: Guest on October-12-2021
1

how to take user input in string in c#

//for user input in C#, you need to first declare the variable 
//suppose we are going to take a input from the user 
string username = Console.Readline() ;
Console.Writeline= (" your name is " + username);

//input 
Sadmansaqib
// Output 
your name is Sadmansaqib
Posted by: Guest on June-09-2021

Code answers related to "how to give user input in c# in char"

C# Answers by Framework

Browse Popular Code Answers by Language