Ticker

6/recent/ticker-posts

Header Ads Widget

Responsive Advertisement

Reversing a String using C

Problem Statement

In this program we will code a basic program to find reverse of a string.

Code

 

#include

#include

void string_rev(char s[])

{

   strrev(s);

   printf("Reverse of the string : %s\n", s);

}

int main()

{

 char s[1000];

 printf("Enter the string ?");

 gets(s);

 string_rev(s);    

}

Output

Enter the string ? – codeofgeeks
Reverse of the string : skeegfoedoc

Post a Comment

0 Comments