Jump to content
Fórum Script Brasil
  • 0

AJUDA PASCAL


benihime

Question

Não estou conseguindo arrumar os erros depois que compilo, alguém poderia me ajudar?

att

B.

Program mnewtonraphson;

uses crt;

var x0,x1,erro,eps: real;

k: interger;

espera: char;

function f (x: real):real;

begin

f:= (4x+2x^2+6);

end;

function df (x: real):real;

begin

df:=(4+2x);

end;

begin

writeln ('Método de Néwton');

writeln ('Solução Inicial');

readln (x0);

writeln ('Digite a precisao');

readln(eps);

writeln('x= ', x0:6:6);

erro:=1;

k:=0;

while

erro >= eps do

begin

x1:= x0-(f/df);

writeln('x= ', x1:6:6);

erro:= abs ((x1-x0)/x1);

x0:=x1;

k:= k+1;

end;

writeln (' Solucao é: ', x0:6:6);

writeln('O numero de iterações é: ',k);

writeln(' Pressione enter para continuar') ;

end.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...