Odd and square numbers: Difference between revisions

no edit summary
(RPL: add section)
No edit summary
Line 326:
841
961</pre>
 
=={{header|Delphi}}==
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
 
 
<syntaxhighlight lang="Delphi">
 
 
procedure ShowOddSquareNumbers(Memo: TMemo);
var I,N: integer;
var Cnt: integer;
var S: string;
begin
Cnt:=0;
for I:=10 to trunc(sqrt(1000)) do
begin
N:=I * I;
if ((N and 1)=1) then
begin
Inc(Cnt);
S:=S+Format('%8D',[N]);
If (Cnt mod 5)=0 then S:=S+CRLF;
end;
end;
Memo.Lines.Add(S);
Memo.Lines.Add('Count='+IntToStr(Cnt));
end;
 
 
</syntaxhighlight>
{{out}}
<pre>
121 169 225 289 361
441 529 625 729 841
961
Count=11
Elapsed Time: 1.975 ms.
</pre>
 
 
=={{header|Draco}}==
465

edits