Keep a "maximum-so-far" date which you preset to minimum possible date before the loop.
Inside the loop, you check the current line's date against the maximum-so-far, and if it is greater, set the new maximum-so-far.
After the loop, print maximum-so-far.
For positive integers in an array:
int max = -1;
for (int i = 0; i < noOfElements; i++)
{
if (arr[i] > max)
{
max = arr[i];
}
}
printf("%u\n", max);
Try that with an array of values and watch what happenes i the debugger - you'll see what I mean.