C Program to Reverse String Without Using strrev function

In this post, we will see how to reverse String without using Library function strrev.

Here is the simple program to reverse a String without using strrev.


Enter the string to reverse:hello

Reverse string is :olleh


We have firstly calculated the length of String using below code.

Then we have started from two ends of string.

and then using while loop, we are exchanging str[start] and str[end]

If you notice, once both start and end reach to the middle of string, while loop will terminate and you will have reversed string in the output.

Leave a Reply

Your email address will not be published. Required fields are marked *