Skip to content

Commit

Permalink
Task 0 completed and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePrimeJnr committed Jun 7, 2023
1 parent d560522 commit db4e8a3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions 0x08-recursion/0-puts_recursion.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#include "main.h"

void _puts_recursion (char *s)
/**
* _puts_recursion - recursively prints a string
* @s: the string to be printed
*
* Author: Destiny Saturday (DestinedCodes)
* Date: 07/06/2023
*/
void _puts_recursion(char *s)
{
if (*s != '\0')
{
_putchar(*s);
_puts_recursion(s + 1);
}
else
{
_putchar('\n');
}
if (*s != '\0')
{
_putchar(*s);
_puts_recursion(s + 1);
}
else
{
_putchar('\n');
}
}

0 comments on commit db4e8a3

Please sign in to comment.