>>838 数表は横並びにxとyが並んでるものと仮定
#include <stdio.h>
#define N 100
int main(void)
{
double xn[N], yn[N], x, y;
int i, cnt;
FILE *fp;
if((fp=fopen("data.txt", "r"))==NULL) return 0;
for(i=0; fscanf(fp, "%lf%lf", xn + i, yn + i)==2; i++);
cnt = i;
scanf("%lf", &x);
if(x < xn[0] || xn[cnt-1] <= x) return 0;
for(i=0; xn[i] < x; i++);
y = (yn[i+1] - yn[i]) * (x - xn[i]) / (xn[i+1] - xn[i]) + yn[i];
printf("y = %f\n", y);
return 0;
}