The strrev()
function is not a standard C program function. However, there are various ways to reverse a string in C. If you want to use strrev()
, you need to include the <string.h>
header, and you can implement it like this:
Program :
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char input[20];
printf(“Enter the String : “);
gets(input);
printf(“\nString Before Reverse : %s”,input);
strrev(input);
printf(“\nString After Reverse : %s”,input);
getch();
}
good