First character reverse and add extra word

Q. Write a C program to accept a string from user and put the first character of word at the end of string and add one extra character.
Enter String: This Is A Good Blog
Result: hisTX sIX AX oodGX logBX


/*c program for taking first character of every word and put it at the end of word and then add one extra word.*/
int main()
 char tmp,str[30];
 int i;
 printf("Enter string : ");
 printf("\n-- Result of program --\n\n");
 for(i=1; str[i]!='\0'; i++)
  if(str[i]==' ')
    printf(" ");
 return 0;

Output of arrangement character in string C program
Screen shot for reverse each first character of word and adding one extra word C program

Related program:

  1. Reverse all string
  2. Reverse all words but not string
  3. Change title case of string
  4. Display string vertically
  5. Search sub string from main string
  6. Search sub string individual from main string
  7. Position and repetition of character in string

No comments:

Post a Comment