Not sure about the exact code in c, but I'd have a while loop checking through the file to see if any numbers match the input. If it matches a previous number in the file, write something to the console and terminate the program. After a certain amount of attempts, break the while loop.