#include stdio.h
#include string.h
void string(char*, int, int);

int main()
{
char string_array[150];
printf("Enter any string:");
scanf("%s", &string_array);
reverse_string(string_array, 0, strlen(string_array)-1);
printf("\nString is: %s",string_array);
return 0;
}
void string(char *x, int start, int end)
{
char ch;
if (start = end)
return;
ch = *(x+start);
*(x+start) = *(x+end);
*(x+end) = ch;
string(x, ++start, --end);
}

If I give 'Sookshmas' as input what exactly would be the output of this code snippet?

Posted on by