You can use below C program to reversing a string. If you want to get input string from user, please use scanf and printf in below program.
#include<stdio.h> #include<string.h> int main() { char name[30] = "Hello"; printf("String before strrev( ) : %s\n",name); printf("String after strrev( ) : %s",strrev(name)); return 0; }
Output:
String before strrev( ) : Hello
String after strrev( ) : olleH
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
String before strrev( ) : Hello
String after strrev( ) : olleH