pascalabcnet/TestSuite/CompilationSamples/Fun2.pas

17 lines
251 B
ObjectPascal
Raw Normal View History

2015-05-14 22:35:07 +03:00
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Power
function Power(x: real; n: integer): real;
begin
Result := 1;
for var i:=1 to n do
Result *= x;
end;
var
x: real;
n: integer;
begin
x := 2; n := 5;
writelnFormat('{0} <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> {1} = {2}',x,n,Power(x,n));
end.