LED PANEL

Google It, You'll Get It.

Saturday, February 5, 2011

String starting with 'b; in a given series of strings


header file stdio.h
header file string.h


main()

{
int i;
const int stringLimit = 5;

char s[stringLimit][50]; //row and column

printf("enter the strings \n");
for(i=0;i gets(s[i]);

/*for(i=0;i // if(str[i][0]=='b';
printf("str %s \n",s[i]);*/

printf("\n strings Starting wIth letter 'b' \n");
for(i=0;i if(s[i][0]=='b')
printf("word %d : %s \n",i+1,s[i]);

}

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);


}