c # cmd if you type something else it shows a msg

-2

Hello, I would like to know how I could do in cmd so that when someone writes something other than tree, a msg says "what you wrote" was not recognized ...

    
asked by anonymous 26.07.2016 / 23:58

1 answer

2

Just do one condition, simple

string input = Console.ReadLine();
if (input == "tree")
{
    Console.WriteLine("tree");
}
else
{
    Console.WriteLine("o que escreveu não foi reconhecido!");
}
    
27.07.2016 / 00:03