to rad the data into variables directly from a file you can use,
fscanf(file,"%d %d %d",a,b,c);
your input file has 4 numbers so you need to neglect it so you can use,
while(fscanf(file,"%d %d %d %d\n",a,b,c,d)==4)
{
r=func(a,b,c);
//some code using value of r
}
you can use code similar to this