title: printing similar words from a string-c
body: <p>i'm new in c programming and i need some help with this function because i cant figure it out,
  i need to make a function that receives a string and prints out the similar words (the order of the letters ,the amount of the letters and if the letters are capital or small doesn't matter) for example:
  if received "Nanny have you any cheap peach?"
  the output is:</p>
  
  <blockquote>
    <p>Nanny any </p>
    
    <p>cheap peach</p>
  </blockquote>
  
  <p>i can't use pointers ,and cant use string.h library.
  i tried and came up with this but i had no luck on figuring it out</p>
  
  <pre><code>void FindSimilarWords(char str2[]){
      int f,i,j,last,count=0,count1=0,k,letter,temp=0;
      char word1[wordsize],word2[wordsize];
  
      for (i = SIZE2 - 1; i &gt;= 0; i--)
      {
          if (str2[i] != ' ' &amp;&amp; str2[i] != '\0')
          {
              last = i;
              break;
          }
      }
      for (i = 0; i&lt;= last; i++)
      {
          k = 0;
          j = i;
          do {
              word1[k] = str2[j];
              k++;
              j++;
          } while (str2[j] != ' '&amp;&amp;str2[j] != '\0');
  
          word1[k] = '\0';
          for (letter =last; letter &gt;= j-1; letter--)
          {
              temp = letter;
              while (temp != ' ')
              {
                  count1++;
                  temp--;
              }
              f = 0;
              for (k--; k &gt;= 0; k--)
              {
                  if (str2[j] == word1[k])
                  {
                      count++;
                      word2[f] = str2[j];
                      f++;
                  }
              }
              if (count == count1)
                  printf("%s %s\n", word1, word2);
              else
                  while (letter != ' ')
                      letter--;
          }
          while (str2[i] != ' ')
              i++;
  
      }
  }   
  </code></pre>