LED PANEL

Google It, You'll Get It.

Saturday, February 5, 2011

Pig - Latin phrase from English language phrase ( Converting words into pig latin )

input : computer
output: omputercay ( omputer + c + ay )
-----------------------------------------------
input : jump
output: umpjay ( ump + j + ay )
-----------------------------------------------

//header file stdio.h
//header file string.h

main()

{
int i=0,wordcount=0;
char word[50];
char reorder[50];
char frst;

printf("enter the word : ");
gets(word);


frst = word[0];

for( i=0 ; word[i+1] != 0 ; i++)
{
reorder[i]=word[i+1];
}

reorder[i]=frst;
reorder[i+1]='a';
reorder[i+2]='y';
reorder[i+3]='\0';


printf("the pigLatin word is %s \n",reorder);


}

4 comments:

  1. WOW!!! thanks men, hmmm hey can you add this thing? The letter 'y' should be treated as a consonant if it is the first letter of a word, but treated as a vowel otherwise and If the original word is capitalized, the new Pig Latin version of the word should be capitalized in the first letter (i.e. the previous capital letter may not be capitalized any more).

    ReplyDelete
  2. and this also If a word starts with a vowel, the Pig Latin version is the original word with "way" added to the end and If a word starts with a consonant, or a series of consecutive consonants, the Pig Latin version transfers all consonants up to the first vowel to the end of the word, and adds "ay" to the end.

    ReplyDelete
  3. if we want to translate pig to english than what we do
    plz tell me its urgent plz

    ReplyDelete
  4. The writings so beautifully composed. They are just irresistible.
    Mason Soiza

    ReplyDelete