Start by defining a struct that counts the items your problem says you are supposed to count. Those are words, same words, sentences, prepositions, and numbers. Here is a possible structure :
struct Counts
{
int words;
int samewords;
int sentences;
int prepositions;
int numbers;
};
Then write code to read the file, determine where words, numbers, and sentences are. Then you can count the various things you are supposed to count. Think about what defines the boundaries between words, numbers, and sentences. I would read each character and decide whether it is part of a word, a number, or a boundary character.
To count matching words you will have to keep track of the words you find. Are the matches of words within one sentence or within the entire file? Either way, you need a mechanism to save each word you find. I have no idea what you have learned so far so I can't tell you how to do that.