#include <stdio.
h>
#include <string.h>
void reverseString(char str[], int start, int end) {
if (start < end) {
// Swap characters at start and end indices
char temp = str[start];
str[start] = str[end];
str[end] = temp;
// Recursive call with updated indices
reverseString(str, start + 1, end - 1);
int main() {
char inputString[100];
// Input from the user
printf("Enter a string: ");
fgets(inputString, sizeof(inputString), stdin);
// Remove newline character from input
inputString[strcspn(inputString, "\n")] = '\0';
// Calculate the length of the string
int length = strlen(inputString);
// Reverse the string using the recursive function
reverseString(inputString, 0, length - 1);
// Display the reversed string
printf("Reversed string: %s\n", inputString);
return 0;