The function reverse(string s) prints the string s in reverse order.
This implementation uses recursion.  Note that we make a helper function
print_reverse_helper to allow it to be called without the length
#include <stdio.h>
#include <string.h>

void print_reverse(char* str);
void print_reverse_helper(char* str, int len);

int main() {
  char s[128];
  printf("Enter a string: ");
  scanf(" %s", s);

  printf("The reverse of %s is \"", s);

  return 0;

// print input string reversed
void print_reverse(char* str) {
  print_reverse_helper(str, strlen(str));

// print string reversed, up to the given length
void print_reverse_helper(char* str, int len) {
  if (len > 0) {
    // print the last character
    // not recurse on the first part of the string
    print_reverse_helper(str, len-1);