strrev function is defined in string.h header file. It reverses a given string. Its basic form is given below:
**strrev(str);**
Here str, a string, is a parameter of strrev() function. This function reverses this string. Please consider the following program:
#include <stdio.h>
#include <string.h>
int main()
{
char str[100];
gets(str);
puts(strrev(str));
return 0;
}
Input:
coder
Output:redoc
By using this program I mean strrev function, you can reverse any number or string. Hope you have understood the use of strrev function in C programming. Happy Coding!!!