Determining where changes begin and end between two files is not a trivial problem if lines have been inserted or deleted in either file.
If you can assume the two files have the same number of lines, the problem is much simpler. Simply read one line from each of the two files. Then compare the respective lines for differences.