How to Get the Random Number in C# ?

01using System;
02using System.Collections.Generic;
03using System.Linq;
04using System.Text;
05 
06namespace AbundantcodeConsoleApp
07{
08    internal class Program
09    {
10        private static void Main(string[] args)
11        {
12            // How to Get the Random Number in C# ?
13            Random random = new Random();
14            int randomNumber = random.Next();
15            Console.WriteLine(randomNumber);
16            Console.ReadLine();
17        }    
18    }
19     
20}

Post a Comment

0 Comments

Close Menu