Following is one way to reverse string using recursion!

#include <stdio.h>
#include <string.h>

void rev_str_recursive(char arr[], size_t iStart, size_t iLast)
{
    if( iStart < iLast )
    {
        //swap
        char temp = arr[iStart];
        arr[iStart] = arr[iLast];
        arr[iLast] = temp;

        rev_str_recursive(arr, ++iStart, --iLast);  
    }
}

void main()
{
    char cArray[] = {"A quick brown fox jumps over a lazy dog"};

    rev_str_recursive(cArray, 0, strlen(cArray)-1);
}
Answer from AFI on Stack Overflow
🌐
Programiz
programiz.com › c-programming › examples › reverse-sentence-recursion
C Program to Reverse a Sentence Using Recursion
Find the Frequency of Characters in a String · Add Two Matrices Using Multi-dimensional Arrays · Calculate the Sum of Natural Numbers · To understand this example, you should have the knowledge of the following C programming topics: C Functions · C User-defined functions · C Recursion · #include <stdio.h> void reverseSentence(); int main() { printf("Enter a sentence: "); reverseSentence(); return 0; } void reverseSentence() { char c; scanf("%c", &c); if (c != '\n') { reverseSentence(); printf("%c", c); } } Output ·
🌐
w3resource
w3resource.com › c-programming-exercises › recursion › c-recursion-exercise-9.php
C Program: Get reverse of a string - w3resource
This recursively moves through the string until it reaches the end. For each recursive call, the function stores the current character at the i-th index of the ‘revstr ‘ array and increments the i variable. Finally, when the first character is null, the function returns the revstr array which contains the reversed string.
🌐
Hero Vired
herovired.com › learning-hub › blogs › reverse-a-string-in-c
C Program to Reverse a String Using for Loop and Recursion
... There are multiple ways to ... characters until reaching the middle. The other methods are using the strrev() function, using pointers, recursion, and stack....
🌐
Techie Delight
techiedelight.com › home › basic › reverse a string using recursion – c, c++, and java
Reverse a string using recursion – C, C++, and Java | Techie Delight
September 19, 2025 - Write a recursive program to efficiently reverse a given string in C, C++, and Java... As seen in the previous post, we can easily reverse a given string using a stack data structure.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-program-to-reverse-a-string-using-recursion
C Program to Reverse a String Using Recursion - GeeksforGeeks
October 15, 2022 - The string can be reversed by using two pointers: one at the start and one at the end. Swap the values of these two pointers while moving the pointers towards each other. Let’s take a look at an example: ... #include <stdio.h> #include <string.h> ...
🌐
BeginnersBook -
beginnersbook.com › home › c programs › c program to reverse a string using recursion
C program to Reverse a String using recursion
May 20, 2024 - #include <stdio.h> #include <string.h> // Function to reverse a string using recursion void reverseString(char* str, int start, int end) { if (start >= end) { return; } // Swap the characters at start and end char temp = str[start]; str[start] = str[end]; str[end] = temp; // Recursively calling ...
🌐
Sanfoundry
sanfoundry.com › c-program-reverse-string-using-recursion-2
C Program to Reverse a String using Recursion - Sanfoundry
May 13, 2022 - Again call the reverse() function by passing the value of ‘str1’ variable and the summation of the value of ‘index’ variable with 1 and the value of ‘size’ variable as argument.
Find elsewhere
🌐
Tutorial Gateway
tutorialgateway.org › c-program-to-reverse-a-string-using-recursion
C Program to Reverse a String using Recursion
April 5, 2025 - #include <stdio.h> #include <string.h> ... "); stringReverse(Str); printf("\n"); } This program uses the temp variable, recursive functions (recursion), and pointers to reverse a given string....
🌐
Vultr
docs.vultr.com › clang › examples › reverse-a-sentence-using-recursion
C Program to Reverse a Sentence Using Recursion | Vultr Docs
November 22, 2024 - By entering into deeper levels of function calls with each character and unwinding those calls in the opposite order, the program effectively reverses the order of characters in the sentence.
🌐
Unstop
unstop.com › home › blog › reverse a string in c in 10 different ways (+code examples)
Reverse A String In C In 10 Different Ways (+Code Examples)
September 13, 2024 - We define a function reverseString() to reverse a string using recursion. It takes three parameters: char * (a pointer to a string), start (starting index of the string), and end ( ending index of the string).
🌐
WsCube Tech
wscubetech.com › resources › c-programming › programs › reverse-string
How to Reverse a String in C? (8 Programs)
October 23, 2025 - Learn How to Reverse a String in C with 8 programs, including loops, recursion, and functions. Easy-to-follow examples for beginners and experts!
🌐
IncludeHelp
includehelp.com › c-programs › reverse-a-string-using-recursion.aspx
C program to reverse a string using recursion
Reversed string is: !oohaY RUN 2: Enter a string: Google Reversed string is: elgooG RUN 3: Enter a string: Hello, world! Reversed string is: !dlrow ,olleH ... In the above program, we created two functions StrRev() and main() function. The StrRev() is a recursive function, here we reversed ...
🌐
Cplusplus
cplusplus.com › forum › beginner › 184744
Reversing a string using recursion - C++ Forum
#include <iostream> #include <string> using namespace std; string reverseRecursion(string str){ if (str.length() == 1) { return str; }else{ return reverseRecursion(str.substr(1,str.length())) + str.at(0); } } int main() { string str; cout<<"Enter the string to reverse : "; getline(cin, str); cout<<"The reversed string is : "<<reverseRecursion(str); return 0; }
🌐
Quora
quora.com › How-do-you-reverse-a-string-using-recursion-in-C-and-C-programming
How to reverse a string using recursion in C++ and C programming - Quora
Answer: A string is a one dimensional character array that is terminated by a null character. The reverse of a string is the same string in opposite order. For example. [code]Original String: Apple is red Reversed String: der si elppA [/code]A program that reverses a sentence in the form of a st...
🌐
Sanfoundry
sanfoundry.com › c-program-reverse-string
Reverse a String in C - Sanfoundry
October 18, 2023 - Enter String: hello world Entered ... Recursive Approach, we swap the character at index i with character at index (n-i-1), where n is the size of the string, until i reaches the middle of the string....
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › reverse-a-string-using-recursion
Print reverse of a string using recursion - GeeksforGeeks
March 6, 2025 - Input: s = "Reverse a string Using ... The idea for this approach is to make a recursive call for the substring starting from the second character and then print the first character....
🌐
Studytonight
studytonight.com › c › programs › recursion › reverse-a-string-using-recursion
C Program to Reverse A String Using Recursion | C Programs | Studytonight
#include<stdio.h> #include<conio.h> // declaring recursive function char* reverse(char* str); void main() { int i, j, k; char str[100]; char *rev; printf("Enter the string:\t"); scanf("%s", str); printf("The original string is: %s\n", str); rev = reverse(str); printf("The reversed string is: ...
🌐
Studytonight
studytonight.com › c-programs › c-program-to-reverse-the-string-using-recursion
C Program To Reverse The String Using Recursion - Studytonight
#include <stdio.h> #include <string.h> void rev(char [], int, int); int main() { char str[50]; int value; printf("Enter The String: "); scanf("%s", str); value = strlen(str); rev(str, 0, value - 1); printf("The String After Reversing: %s\n", str); return 0; } void rev(char str[], int index, int value) { char temp; temp = str[index]; str[index] = str[value - index]; str[value - index] = temp; if (index == value / 2) { return; } rev(str, index + 1, value); } ← Perform Quick Sort on a set of Entries using Recursion← PREV