Code:
#include <stdio.h>

int main ()
{
	int i,a[10],val,n=0,max,min;
	FILE *fi,*fo;
	if((fi=fopen("indata.txt","r"))==NULL)
	{
		printf("Error in opening the file!!!\n");
		return 1;
	}
	
	else
	{
		while(fscanf(fi,"%f",&val))
		{
			a[n]=val;
			n=n+1;
		}
the program is working perfectly fine till here but then it does not calculate max n minimum instead it goes on reading data from input file and finally crashes ... now what to do ?