hi there.so my assignment is to write a program that asks the user to supply 3 integers k,m,n with k being greater than 1.and the program should compute all integers between m and n that are divisible by k.

so this is the coding:

int main()
{

int m, k, n, x ;

printf("Please enter 3 value: \n");
scanf("%d %d %d",&m,&n,&k);

if (k >1)
{
if(m<n)
{
int sum = 0;

for(x = m; x <= n; x++)
{
sum += x;

}

sum /k ;
printf("The result is %d\n",sum/k);
}

else
{
int sum = 0;

for(x = n; x <= m; x++)
{
sum += x;

}

sum /k ;
printf("The result is %d\n",sum/k);
}
}
else
printf("Invalid number\n\n");




system("PAUSE");

return 0;
}



so i actually write the right coding but the next question is the major problem for me..

the question is to upgrade above program to have an option to read the 3 integers from the INPUT DATA FILE.and then after doing the similar computation with the above, write the results in the output data file.the data file is given but i dont know if it is necessary for me to include it in here.

honestly, i dont understand anything about the 2 question so i have google about this, try copy others work and change some part to fix to my question but it doesnt work.so i really need your help to at least tell me what to do first because im sick of reading books that too 'high-level english' for me and im not a native speaker.

yes, my eng is bad.