Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,890 questions

51,817 answers

573 users

How to generate 8 digit random number in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        public const int N = 20; 

        static void Main(string[] args)
        {
            Random rnd = new Random();

            for (int i = 0; i < N; i++)
                Console.WriteLine(rnd.Next(10000000, 99999999));
        }
    }
}


/*
run:
   
21083930
28240929
48407816
62431685
89228284
75546094
79392405
70672283
45961797
60612180
76946228
79703064
88063854
85836410
53190327
35537343
65927449
99029785
62062073
96963913
  
*/

 



answered Apr 27, 2016 by avibootz

Related questions

1 answer 157 views
1 answer 180 views
1 answer 349 views
1 answer 183 views
1 answer 678 views
1 answer 229 views
1 answer 220 views
220 views asked Apr 26, 2016 by avibootz
...