Question: why fgets is not working in c?
Answer: scanf("%c"..) leaves a "newline" in the input buffer, so you get an empty line from fgets(), since it reads everything up to the next newline. Add a space after the format of scanf, e.g. scanf("%c "...) and any newlines and such will be consumed by scanf... It is just one of those strange things.