strrev() function in C by R4R Team

-strrev() is a string function that are able to reverse the given string.
-It is predefined in string.h header file.

syntax:
strrev(string)

program-

#include< stdio.h>
#include< string.h>
int main()
{
char s[20],s1[20];
int i=0,len=0;
//input of string
printf("Enter string\n");
scanf("%s",&s);
printf("String in reverse order is %s",strrev(s));
}


output-

Enter string
Mystring
String in reverse order is gnirtsyM

-In this program, we take an input of the string.
-pass that string in strrev() function that return the reverse of the string and we display that new string.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!