Jump to content

Loops/For with a specified step: Difference between revisions

(→‎{{header|Perl}}: ++ octave)
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}, "}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.