Loops/For with a specified step: Difference between revisions
Content added Content deleted
m (→version 2: changed varaible name. -- ~~~~) |
|||
Line 940: | Line 940: | ||
Output |
Output |
||
<pre>2, 4, 6, 8, who do we appreciate?</pre> |
<pre>2, 4, 6, 8, who do we appreciate?</pre> |
||
=={{header|Rust}}== |
|||
<lang rust>use std::iter::range_step_inclusive; |
|||
fn main() { |
|||
for i in range_step_inclusive(2, 8, 2) { |
|||
print!("{:d}, ", i); |
|||
} |
|||
println("who do we appreciate?!"); |
|||
}</lang> |
|||
=={{header|Salmon}}== |
=={{header|Salmon}}== |