Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  5
Language: PASCAL
Code:
Program Separat_root;
uses crt;
var
a,b,x1,x2,y1,y2,h:real;
n,k:integer;
function f(x:real):real:{уравнение вида F(x)=0)
begin
f:=cos(x)-0.1*x;
end;

begin
clrscr;
writeln('Vvedite a,b,h');read(a,b,h);
k:=0; x1:=a; x2:=x1+h; y1:=f(x1);
while   x2<b  do
  begin y2:=f(x2);
    if  y1*y2<0 then
   begin inc(k);
writeln(k, '-й корень
[' ,x1:4:1, ';' , x2:4:1, '])

  end;
 x1:=x2; x2:=x1+h; y1:=y2;
  end;
repeat until keypressed
  end.

end.          
          
Comments: