Logo 
Search:

C Programming Forum

Ask Question   UnAnswered
Home » Forum » C Programming       RSS Feeds

quadratic interpolation

  Asked By: Nilgun    Date: Dec 16    Category: C Programming    Views: 917
  

I want to a solution of quadratic interpolation function with the logX in c programming
Would you tried to help, but I can not find my mistakes
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define f(x) (log(x))
int i,j;
float x[10],y[10],a,b;
main()
{
printf("\n\t kuadratik enterpolasyon yontemi...\n");
printf("x degerlerini giriniz...\n");
for(i=0;i<=2;i++)
for(j=0;j<=2;i+1)
{

printf("x[%d]= ",i);
scanf("%f",&x[i]);
printf("y[%d])= ",j);
scanf("%f",&y[j]);
}

printf(" x degerleri arasindaki bulmak istenen fonksiyon degerini giriniz..");
scanf("%f",&a);
if(a<x[0]||a>x[2])
{
printf("girilen deger bu aralikta degildir...\n");
printf("lutfen tekrar yeni bir deger giriniz...\n");

}
else
{
b=f(x[0])+(f(x[1])-f(x[0]))/(x[1]-x[0])*(a-x[0])+((f(x[2])-f(x[1]))/(x[2]-x[1])-(f(x[1])-f(x[0]))/(x[1]-x[0]))*(a-x[0])*(a-x[1])/(x[2]-x[0]);
printf("log(%f)=%f",a,b);}
getch();
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on quadratic interpolation Or get search suggestion and latest updates.

Related Topics:



Tagged:    

 
 
 

Related Post