Reverse a String C Program

C Program To Reverse a String

Learn How To Reverse a String in C Programming Language. We have described different versions of String Reversal Program in C Language.

strrev() method is defined in the string.h header file. It is therefore, a Library Function. strrev() method is used to reverse any given string. A String is primarily an Array of Characters.

If you want to input a Multi – word String from the user, you have to use the following scanf() method.

If you want to enter only a single word String, then you can use the following scanf() method.

Must Read: C Program To For String Reversal using Stack Data Structure

Method 1: C Program To Reverse a String using Library Function and Array

C Program To Reverse a String without String Function strrev() and For Loop

Must Read: C Program To Sort Name String in Alphabetical Order


C Program To Reverse a String using Library Function strrev and using Arrays with For Loops

If you have any compilation error or doubts in this C Program For String Reversal without String Functions, let us know about it in the Comment Section below.

Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

4 thoughts on “Reverse a String C Program

  • August 7, 2016 at 9:20 am

    Thanks for so easy methods of reversing a string. Can we use reverse a string using Pointers in C?

    • August 9, 2016 at 10:58 pm

      Yes! Definitely! We can use Pointers in Strings! In fact, many methods of manipulation in string uses pointers!

  • August 20, 2016 at 4:02 pm

    What is better? Reversing a String using Arrays or Reverse a String Array using Stack Data Structure. However, this C program seems more easy in implementation.

    • August 20, 2016 at 10:38 pm

      Stack is also an implementation of array. I would suggest you to understand the logic in both the C Programs To Reverse a String. Even if you know one method, it would be more than enough.


Join The Discussion