#include<stdio.h>
#include<string.h>

int main()
 {
   char str[100], rev;
   int i=0,c,j;
   printf("Enter the string :\n");
   gets(str);
   j = strlen(str)-1;
   while (i < j)
   {
  rev = str[i];
      str[i] = str[j];
      str[j] = rev;
      i++;
      j--;
   }

   printf("\nReverse string is\n%s",str);
   return 0;
}

OUTPUT

C program to reverse the given word using string

Share To:

Arogya Thapa Magar

Post A Comment:

0 comments so far,add yours