How to write a Program to Reverse a String in C Programming Tutorial?

Following is the program to Reverse a String using for loop. #include<stdio.h> #include<conio.h> void main() { int i, j, k; char str[100]; char rev[100]; printf(“Enter a string\t”); scanf(“%s”, str); printf(“The original string is %s”, str); for(i = 0; str[i] != ‘\0’; i++); { k = i-1; } for(j = 0; j <= i-1; j++) { …

How to write a Program to Reverse a String in C Programming Tutorial? Read More »