Problem #1 - depriceted function
gets(str);
This function is deprecated. It shouldn't be used anymore. Use fgets() instead:
fgets(str, sizeof(str), stdin);
Problem #2 - buffer overrun
for(int i=0;i<=101;i++){
You are likely to read memory garbage there. You should stop reading when you reach the end of the string.
Problem #3 - dead code
The following code will never run:
if(strlen(words[i])>longest){
if(strlen(words[i])==longest){
c= strcmp(words[i],words[index]);
}
// ...
}
The reason is that if a > b, then a clearly cannot == b.
Problem #4 - uninitialized variable
The value c is uninitialized. It has no initial value and setting it (see above) is part of a dead code, a conditional one, it should have been initialized anyway.
Therefore when you're trying to read it, it will likely never be equal to -1.
Performance #1 - O(n^2) complexity
You shouldn't call strlen() all the time, especially not in a for loop a it is evaluated every iteration making the problem O(n^2) while it could be just O(n) complex.
So instead of
for(int i =0;i<=(strlen(str));i++){
you could first calculate and save the length and use it in the loop:
size_t length = strlen(str);
for (size_t i = 0; i <= length; i++) {