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.

40,002 questions

51,947 answers

573 users

How to generate 10 digits random numbers in C#

1 Answer

0 votes
using System;
using System.Text;

class Program
{
    static void Main()
    {
        Random rand = new Random(); 

        for (int cout = 0; cout < 20; cout++) {
            string s = string.Empty;
            for (int i = 0; i < 10; i++) {
                s = String.Concat(s, rand.Next(10).ToString());
            } 
            Console.WriteLine(s); 
        }
    }
}
 
 
 
/*
 
run:
 
8237981755
3758200844
2493782530
4084090121
0157529620
9354143090
6535038082
0853318175
9533004435
6911547972
3889908100
5224102059
8472617389
4945107330
2333947704
1647491538
3431667630
2974751421
3933774711
9195789272

*/

 



answered Jun 18, 2019 by avibootz

Related questions

1 answer 140 views
1 answer 114 views
1 answer 292 views
2 answers 155 views
1 answer 116 views
2 answers 501 views
1 answer 152 views
...