Mahesh Chand

Mahesh Chand

  • 1
  • 269.2k
  • 239.7m

How To Generate a random number in C#

Sep 9 2018 1:14 PM
The following code in Listing 1 returns a random number. 
  1. // Generate a random number  
  2. Random random = new Random();  
  3. // Any random integer  
  4. int num = random.Next();  

Answers (1)