Counting words means taking each char, one at a time, and sending it to isspace(). If you get a return indicating the char is not a letter, then you are at the end of a word, so increment your count of words.
Exceptions might rear their ugly head - things like blank lines in double spaced "block" style paragraphs, etc. You may need to have code to handle two newlines in a row mean don't increment the word count, or increment it, and then subtract one when the second newline is found.
Code:
//Opening the "destination.txt" file in write text mode
if((outfile = fopen("destination.txt", "wt") == NULL) {
printf(" Unable to open destination.txt file \n");
exit (1);
}
//if your code reaches here, you know the file was opened OK
//rest of your code, here.