plz c this fortran code

Joined
Oct 1, 2010
Messages
1
Reaction score
0
Points
1
hello..this is a general newton forward difference ccode..where and what will change for newtons forward DIVIDED difference?.
.program Divided_Differences_Iterpolation dimension x(20),y(20),d(20,20)
n=7
xx=.7
data (x(i), i=1,7) /0,.5,1,1.4,2,3.2,5.5/
data (y(i), i=1,7)/-1.25,-3.5,6,2.32,1.5,1.27,5.6/
s=y(1)
do i=1,n-1
do j=1,n-i
y(j)=(y(j+1)-y(j))/(x(j+i)-x(j))
d(i,j)=y(j) print*,d(i,j)
enddo
enddo
do i=1,n-1
p=1
do j=1,i p=p*(xx-x(j))
enddo
s=s+d(i,1)*p enddo print*,'Inte
rpolation of(',xx,')=',s
end

please ..a quick reply is needed..thank u
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
First, what is the question? We don't do peoples homework for them here.

Second, if you are going to post code, use the CODE tag to wrap it. Also make it cleanly formatted. Yours is messy and difficult to follow in a few places.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top