Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Fruit List

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

Expected output:

text
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() {
}