please write this code in C, not C++ or java also assume the string library has been included Consider this data sequence: \"fish bird reptile reptile bird bird bird mammal fish\". Let\'s define a SINGLETON to be a data element that is not repeated immediately before or after itself in the sequence. So, here there are four SINGLETONs (the first appearance of \"fish\", the first appearance of \"bird\", \"mammal\", and the second appearance of \"fish\"). Write some code that uses a loop to read a sequence of words, terminated by the \"xxxxx\". The code assigns to the variable n the number of SINGLETONs that were read. (For example in the above data sequence it would assign 4 to n ). Assume that n has already been declared but notinitialized . Assume that there will be at least one word before the terminating \"xxxxx\". Assume that the maximum length of a string is 8. Solution #include <stdio.h> #include <string.h> int isAvail(char words[20][20], int len,char word[]) { int i; for(i=0;i<len;i++) { if(strcmp(words[i],word)==0) { return 1; } } return 0; } void SINGLETON(char str[],int *p) { int i,j=0; *p=0; char words[20][20]; int len=0; char prev[20]; char curr[20]; char next[20]; strcpy(curr,\"\"); strcpy(prev,\"\"); strcpy(next,\"\"); for(i=0;i<strlen(str);i++) { if(str[i]!=\' \') { curr[j++]=str[i]; } else if(str[i]==\' \') { j=0; if(strcmp(prev,curr)!=0 && strcmp(curr,next)!=0 && isAvail(words,len,curr)==0) { (*(p))++; } strcpy(words[len++],curr); strcpy(prev,\"\"); strcpy(prev,curr); strcpy(curr,\"\"); strcpy(curr,next); strcpy(next,\"\"); } } } int main() { int n; char str[]=\"fish bird reptile reptile bird bird bird mammal fish\"; SINGLETON(str,&n); printf(\"number of singletons: %d\",n); return 0; } .