I have try to get input from user for two time for each case like R,S,T. Now I am able to get input in single time only. How can I get input for two times in each case.
When I press S or T or R form should be close automatically.
public class Program
{
public static void Main()
{
string mystring = null;
Console.WriteLine("Enter your input : ");
mystring = Console.ReadLine();
switch (mystring)
{
case "R":
Console.WriteLine("R");
break;
case "S":
Console.WriteLine("S");
break;
case "T":
Console.WriteLine("T");
break;
}
}
}
OLD Output:
Enter your input :
R
R
Required OUTPUT:
Enter your input :
R
R
Enter your input :
S
S
Enter your input :
T
T
I would except continuously get user input in two or three times.
Note : When I press R,S or T key word form should be closed automatically.