Exerpad
🔥 0
0 XP
Exercise 1 · Chapter: VectorsRequired+50 XP

Fruit List

Create a vector with 3 fruits: "apple", "banana", and "cherry". Then print each fruit on its own line.

Expected output:

apple
banana
cherry

Hints:

  • Use vec!["apple", "banana", "cherry"] to create your vector
  • Use a for loop with & to go through the items
  • Print each item with println!("{}", fruit)
rust
fn main() {
}
Output
Run your code to see the output here.