answersLogoWhite

0

#include<stdio.h>

#include<math.h>

int main()

{

float x[10],y[10][10],sum,p,u,temp;

int i,n,j,k=0,f,m;

float fact(int);

printf("\nhow many record you will be enter: ");

scanf("%d",&n);

for(i=0; i<n; i++)

{

printf("\n\nenter the value of x%d: ",i);

scanf("%f",&x[i]);

printf("\n\nenter the value of f(x%d): ",i);

scanf("%f",&y[k][i]);

}

printf("\n\nEnter X for finding f(x): ");

scanf("%f",&p);

for(i=1;i<n;i++)

{

k=i;

for(j=0;j<n-i;j++)

{

y[i][j]=(y[i-1][j+1]-y[i-1][j])/(x[k]-x[j]);

k++;

}

}

printf("\n_____________________________________________________\n");

printf("\n x(i)\t y(i)\t y1(i) y2(i) y3(i) y4(i)");

printf("\n_____________________________________________________\n");

for(i=0;i<n;i++)

{

printf("\n %.3f",x[i]);

for(j=0;j<n-i;j++)

{

printf(" ");

printf(" %.3f",y[j][i]);

}

printf("\n");

}

i=0;

do

{

if(x[i]<p && p<x[i+1])

k=1;

else

i++;

}while(k != 1);

f=i;

sum=0;

for(i=0;i<n-1;i++)

{

k=f;

temp=1;

for(j=0;j<i;j++)

{

temp = temp * (p - x[k]);

k++;

}

sum = sum + temp*(y[i][f]);

}

printf("\n\n f(%.2f) = %f ",p,sum);

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the difference in 200 newtons and 20 newtons?

The difference between 200 newtons and 20 newtons is 180 newtons.


What is the acceleration when the force is 50 newton?

That depends on the mass. Acceleration = (50 newtons) divided by (the mass)


How do you change pounds to newtons?

Formula: pounds x 4.448 = newtons


What is the equation to find Newtons?

Also if you mean Newtons in terms of weight the formula is Newtons = Mass * Gravity


What is force in newtons divided by the area?

Force divided by area is pressure. If the force is in newtons and the area is in metres squared, the pressure will be in pascals (Pa).


What is the formula to calculate force in newtons when given the mass in kilograms and acceleration in meters per second squared?

The formula to calculate force in newtons is force mass x acceleration.


What is the mass of an object if the force of gravity acting on its mass is 6.5 Newtons?

The object's mass in kg is determined by the formula: Mass = Force(N) divided by acceleration(9.8). So, 6.5N / 9.8 = 0.66kg


How do you convert 25 Newtons to pounds?

To convert Newtons to pounds, divide the Newton value by 4.45. So, 25 Newtons would be approximately 5.62 pounds (25 divided by 4.45).


Which formula indicates newtons second law motion?

F = m a


What is 3 newtons la w?

distance travel divided by the time of travel


Formula for pressure?

P=newtons/area... Area is squared... newtons is the stationary form for force.


How do you find N?

If by N you mean Newtons, then the formula to use would be Force=mass x acceleration. Newtons is the unit of measurement for force