C Program to Reverse the Given String Using String Function

Ex: Write a C program to reverse the given string  using String function. How to write a C program to reverse the given string  using String function. C program to reverse the given string  using String function.




Program:

#include <stdio.h>
#include <string.h>
void main()
{
   char s[100];
  //Accept string from user using gets() function
   printf("\n Please Enter Any String : ");
   gets(s);
 //Reverse the given string using strrev() function
   strrev(s);
//Print reversed string on the output screen
   printf("\n string After Reversing : %s\n", s);

}


Above Program show's the following  output:

C program to reverse the given string  using String function


No comments:

Post a Comment

If you have any doubts, please discuss here...👇