Code:
int main(){
char line[256];
int i, VPD;
float vapourp, setvapp;
float val;
FILE *in = fopen("KBIS_2005.txt", "r");
for(i = 0; i<=240; i++)
{
fgets(line,256,in);
retv=sscanf(line,"%d %f %f %d",&Time,&DewPointC,&DryTempC,&RH);
if (!retv) continue;
printf("%d items read: %d %f %f %d\n",retv,Time,DewPointC,DryTempC,RH);
vapourp = pow(611, (7.5 * DewPointC)/(237.7 + DewPointC));
setvapp = pow(611,(7.5 * DryTempC)/(237.7 + DryTempC));
printf("setvapp is %s",setvapp);
float VPD;
VPD = setvapp - vapourp;
}
printf("VPD IS %s",VPD);
}
now i can read the data..now i need to calculate the above formula taking each value of time, dewpointc, drypointc and RH. i tried to run this code but don;t know it is giving the result.