Anonymous user
Loops/For with a specified step: Difference between revisions
→{{header|Ruby}}: ++ R
(→{{header|Perl}}: ++ octave) |
(→{{header|Ruby}}: ++ R) |
||
Line 84:
Output
<pre>2, 4, 6, 8, who do we appreciate?</pre>
=={{header|R}}==
<lang R>for(a in seq(2,8,2)) {
cat(a, ", ")
}
cat("who do we appreciate?\n")</lang>
=={{header|Ruby}}==
<lang ruby>2.step(8,2) {|n| print "#{n}, "}
|