Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Call rand package for random number generation
- extern crate rand;
- use rand::Rng;
- fn main() {
- const SIZE: usize = 10;
- let mut array = [0; SIZE];
- for i in 0..array.len() {
- // Set a random number between 1 and 100
- array[i] = rand::thread_rng().gen_range(1, 100 + 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement