Created
October 3, 2018 23:51
-
-
Save topherPedersen/cdb4a1bdadcde2a4255d458042c8876f to your computer and use it in GitHub Desktop.
User Input & Random Numbers in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class MainClass { | |
| public static void Main (string[] args) { | |
| Console.WriteLine ("User Input & Random Numbers in C#"); | |
| // USER INPUT IN C# | |
| /* | |
| Console.Write("PROMPT> "); | |
| string userInput = Console.ReadLine(); | |
| Console.WriteLine("ECHO: " + userInput); | |
| */ | |
| // RANDOM NUMBERS IN C# | |
| /* | |
| Random random = new Random(); | |
| int myRandomNumber = random.Next(0, 2); | |
| Console.WriteLine("My Random Number: " + myRandomNumber); | |
| */ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment