Complete the code to declare a fixed-size array of 5 integers in Rust.
let numbers: [i32; 5] = [1];
In Rust, arrays are declared using square brackets with elements inside, like [1, 2, 3, 4, 5].
Complete the code to access the third element of the array named 'values'.
let third = values[1];Array elements are accessed using square brackets with zero-based indexing, so the third element is at index 2.
Fix the error in the code to create a vector with initial elements 10, 20, 30.
let mut vec = Vec::new(); vec.[1](10); vec.[1](20); vec.[1](30);
To add elements to a vector in Rust, use the push method.
Fill both blanks to create a vector from an array and then get its length.
let arr = [1, 2, 3, 4]; let vec = Vec::[1](&arr); let len = vec.[2]();
Use Vec::from to create a vector from an array, and len() to get its length.
Fill all three blanks to filter even numbers from a vector and collect them into a new vector.
let numbers = vec![1, 2, 3, 4, 5, 6]; let evens: Vec<i32> = numbers.iter() .[1](|&x| x [2] 2 == 0) .[3]();
Use filter to keep only even numbers, % for modulo operation, and collect() to gather results into a vector.
