Hello, I’m working on this task:
Write a program that reads 2 characters from the console and outputs them on one line. You can use either the Console.Read() or Console.ReadLine() methods. For example:
>K
>2
K2
Here is my code:
namespace CharType
{
class OneLine
{
static void Main(string[] args)
{
char char1 = Convert.ToChar(Console.Read());
char char2 = Convert.ToChar(Console.Read());
Console.Write(char1);
Console.Write(char2);
}
}
}
Can anyone please help me to solve it?