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,895 questions

51,826 answers

573 users

How to generate 8 digits random number in Rust

1 Answer

0 votes
use rand::Rng;

fn main() {
    let mut rng = rand::thread_rng();
    
    for _ in 0..10 {
        println!("{}", rng.gen_range(10000000..100000000));
    }
}
  
    
/*
run:

74696237
97423444
73626293
67997640
11542500
86863509
50281162
25607176
82126662
34464865
  
*/

 



answered Oct 7, 2024 by avibootz

Related questions

...