[Solved] C# Console Create simple app not longer than 2 lines


One way to do is use a ternary operator inside another ternary operator.
It does the job in two lines.

    var input = Console.ReadLine();
    Console.WriteLine((input == "1") ? ("2") : (input == "2" ? "1" : "Enter 1 or 2"));

2

solved C# Console Create simple app not longer than 2 lines