Find Biggest
Find and print the largest number in this vector: vec![4, 9, 2, 7, 5].
Expected output:
text
9
Hints:
- Start by setting
maxto the first item:let mut max = numbers[0]; - Loop through the vector with
for &n in &numbers - If
n > max, updatemaxton - Print
maxat the end
rust
fn main() {
}