Const a=1; b=4; m=10;
var x,f,h:real; i:integer;
begin
h:=(b-a)/m;
x:=a-h;
for i:=0 to m do
begin
x:=x+h;
f:=exp(-x)+cos(3*x);
writeln(x:5:1,f:8:3);
end;
end.
Результат:
1.0 -0.622
1.3 -0.453
1.6 0.289
1.9 0.984
2.2 1.061
2.5 0.429
2.8 -0.458
3.1 -0.947
3.4 -0.681
3.7 0.129
4.0 0.862