Friday, 12 August 2016

strrev: Reversing the string using library function

String: strrev(string)

Reversing the string using library function


#include<stdio.h>          
#include<string.h>
main()
{
                char s[60];
                printf("\nEnter string:\t");
                gets(s);
                printf("\nReversed string is:  %s", strrev(s));
}
Output:
Enter string:   Hello How Are You
Reversed string is:  uoY erA woH olleH