Forums - C# Corner

Forum guidelines
Mahesh Chand

Mahesh Chand

  • Admin
  • 360.8k
  • 132.9m

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)