What's The Program To Print The Reverse String Of A Given String?


1 Answers

Alongbar Daimary Profile
Include the header file string.h in your program. And use strrev() function to reverse the give string.  C++ Example: #include<iostream.h> #include<string.h> #include<conio.h> void main(){ char st[100]; cout<<"Enter the String:"; cin>>st; cout<<"Reversed String:"<<strrev(st); getch(); } C Example: #include<stdio.h> #include<string.h> #include<conio.h> void main(){ char st[100]; printf("Enter the String:"); scanf("%s",st); printf("Reversed String: %s",strrev(st)); getch();  }

Answer Question