pascalabcnet/TestSuite/CompilationSamples/Fun1.pas

22 lines
399 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Определение функции. Вывод таблицы ее значений
function MyFun(x: real): real;
begin
Result := x*sin(x);
end;
const
a = 0.0;
b = 2*Pi;
n = 10;
begin
var h := (b-a)/n;
var x := a;
writeln('Таблица значений функции MyFun:');
for var i := 0 to n do
begin
writeln(x:5:2,MyFun(x):10:4);
x += h;
end;
end.