Wisdom Materials
Home
About Us
Our Clients
Careers
Services
Education
Jobs
News
Business
Health
Astrology
Entertainment
RealEstate
Devotion
Contact Us
C Programs
/ String reverse C program
Program Name
Write a C Program for String reverse C program.
Theory
String reverse C program used to reverse the characters of the string.
Program Code
Copy Program Code
#include
#include
#include
#include
int main() { char name[20],rev[20]; int len,i,j=0; printf("Enter a string: "); scanf("%s",name); len=strlen(name); printf("Original String: %s",name); for(i=len-1;i>=0;i--,j++) rev[j]=name[i]; rev[j]='\0'; printf("\nString Reverse: %s",rev); return 0; }
Input
Enter a string: abcd
Output
Original String: abcd String Reverse: dcba
Online C Compiler (To copy paste and Run the c program)
Home
Back