Ask Question
19 August, 01:43

Write a recursive function stringReverse that takes a character array as an argument, prints it back to front and returns nothing. The function should stop processing and return when the terminating null character of the string is encountered.

+5
Answers (1)
  1. 19 August, 03:15
    0
    Refer below for the code.

    Explanation:

    #include

    void stringReverse (char[]);

    //function declaration

    int main ()

    / / main function

    {

    char str[25];

    printf ("String to reverse: ");

    / / user input

    scanf ("%s", str);

    printf ("/nString that is reversed is: / n"); / /

    stringReverse (str);

    return 0;

    }

    void stringReverse (char*arrayString)

    {

    if (*arrayString=='/0') {

    return;

    }

    else{

    stringReverse (arrayString+1);

    }

    printf ("%c", arrayString[0]);

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a recursive function stringReverse that takes a character array as an argument, prints it back to front and returns nothing. The ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers