Ask Question
9 October, 04:54

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.

+2
Answers (1)
  1. 9 October, 08:11
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers