Is there a way to write code so that when a user gives input, either a string or a number, that the program will choose the most appropriate of the available variables that have been declared?
Pseudocode example:
static void Main()
{
int A;
string B;
Console.Write("enter something: ");
if (user enters a number)
A = int.Parse(Console.ReadLine());
else
B = Console.ReadLine();
}