Q:

C program to print a string using recursion

0

C program to print a string using recursion

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include 

void print(char*);

int main() {
   char s[100];
   gets(s);
   print(s);
   return 0;
}

void print(char *t) {
   if (*t == '\0') // Base case
      return;
   printf("%c", *t);
   print(++t);
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now