Hey, what's going on?

Numerical Methods in Pascal: Simple Euler

Posted by Syeilendra Pramuditya on April 28, 2014

Program Simple_Euler;
{https://syeilendrapramuditya.wordpress.com}
uses crt;
var h,x0,y0,x,y : real;
    i,N : integer;

Function Fxy(x,y:real):real;
begin
Fxy := sqrt(x*x + y*y);
end;

Begin
clrscr;
write('Masukan nilai x0 dan y0 : ');readln(x0,y0);
write('Masukan nilai h dan N   : ');readln(h,N);
x:=x0;
for i := 1 to N do
 begin
 x := x0 + h;
 y := y0 + h*Fxy(x0,y0);
 writeln('x = ',x:10:5,'    y = ',y:10:5);
 x0:=x;
 y0:=y;
 end;
readln;
end.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: