In this C program, we are taking string input from the user and outputting the reverse of the input string.

Example:

If the user enters ‘Pencil‘, then the output will be ‘licneP‘.

Reverse a String in C using library function

Output of Program

C Program to reverse a String

Reverse a String in C without using library function

Output of Program

Reverse a string in C

The above programs also reverse the string with space. Means whole string sentence can also be reversed using the given string reversal program. If you have any doubt then do comment below.

Leave a Reply

Close Menu