That's not a compilable program which shows your problem.
If I use the example exams file from your post #1:
and turn your code snippet into a working program:
$ cat Exams.txt
5 1 Lab 01
17 2 Lecture(31.10.)
I get the following output:
FILE *fin=fopen("Exams.txt", "r");
fgets(tmp, sizeof(char)*100, fin);
That's why I've asked for a small, compilable program which shows that you get the output 5 times, because as you can see the code snippet you have posted just outputs the line once.