Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Created October 3, 2018 23:51
Show Gist options
  • Select an option

  • Save topherPedersen/cdb4a1bdadcde2a4255d458042c8876f to your computer and use it in GitHub Desktop.

Select an option

Save topherPedersen/cdb4a1bdadcde2a4255d458042c8876f to your computer and use it in GitHub Desktop.
User Input & Random Numbers in C#
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