Can anyone help me to create a program in c that the user will input his/her username and password and the program will search to a file. And if that username and password are in the file for example the user input:

username: user
password: pass

and the value of the file are:
user1 pass1 08
user pass 78
username password 19

it should be successfully login because the username and password of the user matches the value in the second line of the file and the user_id umber 78 will be save to another variable. But if it is not the program will print "Invalid Username or Password".
Please guys help me to create this program.i really try to make this but always error and sometimes segmentation fault.. Actually im running out of time because tomorrow will be the deadline of submission of the project.