jamieerr 0 Newbie Poster

This is what I have so far, but I must incorporate the fgets, strtok, and strlen, to meet my professors requirements.

#include "stdio.h"
#include "string.h"

main()
{
  char word[40], latin[40], temp[40], vowels[6] = "aeiou";
char *foundat, *i, *j;
int where;
     printf("Enter a word\n");
     gets(word);
     foundat = '\0';
     i = vowels;
     for (i = vowels; *i, i++)
      {
            for (j = word; *j; j++)
            {
             if (*j == *i)
              {
                if(!foundat) foundat = j;
                else if (j < foundat) foundat = j;
                 break;
                  }
              }
        }
  printf("\n found at %s,*foundat);

i = latinn;
for (j = foundat; *j; j++)
{
  *i = *j;
   i ++;
   }

for (j = word; j != foundat; j++)
{
  *i = *j;
   i++;
}
*i = '\0';

printf("\n reversed is %s", latin);

*i++ = 'a';
*i++ = 'y';
*i = '\0';
printf("\n pig latin is %s", latin);


return;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.