strrev(): String Reverse in C Programming

String handling function strrev() is used to reverse string in C programming language. Function strrev(str1) reverses the content of string str1.

strrev() Syntax


strrev() Program


int main()
	char name[40];
	printf("Enter your name: ");
	printf("Reversed name is: %s", name);
  return 0;	

strrev() Program Output

Enter youe name: Jenny↲
Reversed name is: ynneJ

Note: ↲ indicates ENTER is pressed.