Jump to content

Odd and square numbers: Difference between revisions

(added Arturo)
Line 812:
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">lo, hi = 100, 1000
(Integer.sqrt(lo)..Integer.sqrt(hi)).each{|n| puts n*n if n.odd?}</syntaxhighlight>
{{out}}
<pre>
121
169
225
289
361
441
529
625
729
841
961
</pre>
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">var lo = 100
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.