Generate random number : Random : Development C# Examples


C# Examples » Development » Random »

 

Generate random number









    
using  System;    
    
class  MainClass  {          
    public  static  void  Main()  {          
        Random  ran  =  new  Random();  
  
        Console.WriteLine(ran.Next(1,  7));    
    }          
}
    
   
  
   



Output

6


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Random