Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

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 max to the first item: let mut max = numbers[0];
  • Loop through the vector with for &n in &numbers
  • If n > max, update max to n
  • Print max at the end
rust
fn main() {
}