1. uses Console.ReadLine() to read user input. 2. use simpler statement for if condition string message = (uservalue == "1") ? "boat" : "strand of lint"; //WriteLine() can use variable contains text to be print out {o} [appointing message variable] Console.WriteLine("you won = {0}", message); //WriteLine can also be written by passing two variables Console.WriteLine("you won= {0}", message, userValue);
This is a blog that shares tips on Coding, Website, E-Commerce, Windows, Linux and IT related infos.