Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Times Table

Use a while loop to print the 7 times table from 7 x 1 up to 7 x 10.

Expected output:

text
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70

Hints:

  • Use a counter from 1 to 10
  • Multiply 7 by the counter to get each result
  • Use println!("7 x {} = {}", i, 7 * i); for formatting
rust
fn main() {
}