My Profile
Active Members
TodayLast 7 Days
more...
Awards & Gifts
Online Exams
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian
cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
|
//C++ program for newton backward interpolation formula
Posted Date: 23 Mar 2008 Resource Type: Articles/Knowledge Sharing Category: Computer & Technology
|
Posted By: ashish singh Member Level: Diamond Rating: Points: 2
|
//program for newton backward interpolation formula #include #include #include #define maxn 100 #define order 4 void main() { float ax[maxn+1],ay[maxn+1],diff[maxn+1][order+1],nr=1,dr=1,x,p,h,yp; int n,i,j,k; clrscr(); cout<<"enter the value of n\n"; cin>>n; cout<<"enter the values in form x,y\n"; for(i=1;i<=n;i++) {cin>>ax[i]>>ay[i];} cout<<"enter the value of x for which value of y is wanted\n"; cin>>x; h=ax[2]-ax[1]; for(i=n;i>=1;i--) {diff[i][1]=ay[i]-ay[i-1];} for(j=2;j<=order;j++) { for(i=n;i>j;i--) {diff[i][j]=diff[i][j-1]-diff[i-1][j-1];} } i=n; p=(x-ax[i])/h; yp=ay[i]; for(k=1;k<=order;k++) { nr*=p+k-1; dr*=k; yp+=(nr/dr)*diff[i][k]; } cout<<"when x = "<
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
|
Watch TV Channels
|