Code:
using System;
namespace namespace1
{
class class1
{
static void Main(String[] args)
{
Console.WriteLine("What is your initial?");
int name1 = Console.Read();
char ch = Convert.ToChar(name1);
Console.WriteLine("What is your name again?");
string name2 = Console.ReadLine();
Console.WriteLine("This is the name1 " + ch + "\nThis is the name2 " + name2);
}
}
}
What is your initial?
testing
What is your name again?
This is the name1 t
This is the name2 esting
Press any key to continue . . .
How to let the console capture the first char in the first input and prompt user to key in second input ?
Comment