There are many ways to reverse a string in c. i.e using while loop, using string library function strrev(), using for loop etc.
in this article, we clearly discussed with an easy example how to reverse a string without using the inbuilt function with examples.
Reverse a string using For loop
output:
in the above example, we created a function named len() to get the length of the string then we use for loop to read characters one by one from the given String in reverse order and write them into a new character array to create the reverse string
0 Comments