8raker

8raker

  • NA
  • 1
  • 0

Help with user inputs for c#

Oct 14 2004 8:55 PM
I have recently started c#. I love it. I used to code in basic, but now C# has incorparated the easiness of basic and some of the features of C++. I was wondering if anyone could help me with user input. I would like to create a number guessing game. Ex: Im a even number. I am between 10 and 50. I am not any 30's though. Say the number was 28. How could the user input 28? I would do something like using System; public class Age { public static void Main() { Console.WriteLine("Please input your age."); string line = Console.ReadLine(); Console.WriteLine("You can now smoke!"); } } Something like that. One last question. How could I make it so if you say your 21 then It would say "You can drink beer!" and like if your 18 "You can smoke" and etc.? How could I make it determine the age inputed and print special messages basically? TIA 8raker

Answers (1)