The following is a C Program To Reverse String Using Recursion on screen after taking input from the user. Let's get started.

Reverse String Using Recursion
Reverse String Using Recursion

Overview:


Commands

scanf() function is used to obtain input as a string and printf() function is used to print the string on the screen.
void reverse() is a function used for recursion strings and ultimately reverse them.

Program

#include<stdio.h>
#include<conio.h>
void reverse();
void main()
{
    clrscr();
    printf("Please enter a sentence: ");
    reverse();
    getch();
}
void reverse()
{
    char c;
    scanf("%c",&c);
    if(c!='\n')
    {
        reverse();
        printf("%c",c);
    }
}


Output

String Reversed
String Reversed

All programs compiled in this post are compiled in AnDOSBox.

Books I Prefer:






I hope this article was helpful to understand C Program To Reverse String Using Recursion! Comment below, if you've got any question. Head back soon for another interesting article on C Programming.