The below program calculates the largest no among the no entered but it just calculates as user inputs them. This can be used with files and as you move ahead in file you can store the max and the min value in a variable when parsing the file.
printf("Go on entering numbers\n");
printf("%d\t",m); /*prints the largest of the number inputed till now*/
int largest(int n,int m)