Don't use/declare global variables, instead declare them in main and pass them to the functions that use them. This makes it more clear where they are used. If there is lots of data that you want to pass to a function create a struct with them and pass it to the function, caveat: only place things that logically belong together in a struct
Always initialize all variable declarations and try to place them on different lines, it is a bit more verbose but more clear (IMHO).
When you use fgets, use the sizeof on the buffer to avoid later changin the size of the buffer and forgetting to change all fgets where it is used.
fgets( input, sizeof(input), stdin );
Always explain any constants e.g. count=3 (no magic numbers)
Instead of lots of indent levels try to split up your program into functions e.g. you have one part where you read the text file text, that could be placed in a separate function e.g. int showFile(const char* fileName);
always looks for patterns to break out into separate functions -- another repeated functionality you have is reading the password from the keyboard, this could be placed in a separate function as well which returns the password.
e.g. char* getPassword(const char* prompt, char* passwordBuffer, int maxLen);
use puts instead of printf when there is only one argument with no format specifiers
puts("The password you entered is incorrect!");
your main function should return an integer even though some compilers add it automatically you should make a habit to add a return statement in main.
use descriptive variable names, 'c','i' are poor choices.