I have to create a ranges out of these lines in file
Input:
------------
9849201348
9849201349
9849201350
9849201400
9849203000
9849209000
9849210000
9849215000
9849220000
output
-------
range 1: 9849201348 to 9849210000
range 2: 9849215000 to 9849220000
Usually there will be millions of lines of code .The numbers will be in sorted order but not in a consecutive manner...like after 9849201350 ,9849201400 may appear...The difference between
9849201400 -9849201350 =50 .If the difference between 2 numbers is greater than 10000 then we have to take the numbers encountered as one range.
i,e range 1: 9849201348 to 9849210000 for the above example...
If i follow the rule like taking the first line in the series and adding 10000 and taking it as one range ..But the number may not be present in the file.so shall i have to go linear way or what...Can anyone please send me the code for getting the output as shown above in C language....