Const a=-5; b=12; h=0.2; x0=-2; xk=2;
var x,y:real; i:integer;
begin
x:=x0-h;
for i:=1 to round((xk-x0)/h)+1 do
begin
x:=x+h;
if x<-pi/2<br> then y:=2*sin(x)
else if x writeln(x:4:1,y:9:4);
end;
end.
Результат:
-2.0 -1.8186
-1.8 -1.9477
-1.6 -1.9991
-1.4 16.9272
-1.2 16.6602
-1.0 16.2074
-0.8 15.5868
-0.6 14.8232
-0.4 13.9471
-0.2 12.9933
0.0 12.0000
0.2 11.0067
0.4 10.0529
0.6 9.1768
0.8 8.4132
1.0 7.7926
1.2 7.3398
1.4 7.0728
1.6 -0.0292
1.8 -0.2272
2.0 -0.4161