STRREV() Function – C Program

STRREV() Function – C Program

Write a C Program to get string from user and display string in reverse order using STRREV() Function.

STRREV() Function – The STRREV() Function used to returns reverse order string of given string.

The Syntax of STRREV() Function :

strrev(str1) – display str1 contains to reverse order.

Example of STRREV() Function C Program

#include<stdio.h>
#include<string.h>
 
int  main()
{
char str[30];

printf("Enter the string =");
gets(str);
 
printf("\nThe reverse string = %s", strrev(str));

return 0;
}

The output of STRREV() Function C Program is :

Enter the string = Meera
The reverse string = areeM

 

Author: Meera Academy

Leave a Reply

Your email address will not be published. Required fields are marked *