Skip to content

Latest commit

 

History

History

README.md

0x08. C - Recursion 🔁🔀

In this directory, you'll find a set of C programs that focus on recursive functions. Each program is designed to showcase different aspects of recursion, from string manipulation to mathematical calculations. Dive into each task to strengthen your understanding of recursion and its applications.

Task 0 - Print a String Recursively

File: 0-puts_recursion.c
📝 Description: Prints a string followed by a new line using recursion.
💼 Prototype: void _puts_recursion(char *s);


Task 1 - Print a String in Reverse

File: 1-print_rev_recursion.c
📝 Description: Prints a string in reverse using recursion.
💼 Prototype: void _print_rev_recursion(char *s);


Task 2 - Calculate String Length

File: 2-strlen_recursion.c
📝 Description: Returns the length of a string using recursion.
💼 Prototype: int _strlen_recursion(char *s);


Task 3 - Calculate Factorial

File: 3-factorial.c
📝 Description: Returns the factorial of a given number using recursion.
💼 Prototype: int factorial(int n);


Task 4 - Calculate Power

File: 4-pow_recursion.c
📝 Description: Returns the value of x raised to the power of y using recursion.
💼 Prototype: int _pow_recursion(int x, int y);


Task 5 - Calculate Square Root

File: 5-sqrt_recursion.c
📝 Description: Returns the natural square root of a number using recursion.
💼 Prototype: int _sqrt_recursion(int n);


Task 6 - Check Prime Number

File: 6-is_prime_number.c
📝 Description: Returns 1 if the input integer is a prime number, otherwise returns 0 using recursion.
💼 Prototype: int is_prime_number(int n);


Task 7 - Check Palindrome

File: 100-is_palindrome.c
📝 Description: Returns 1 if a string is a palindrome and 0 if not using recursion.
💼 Prototype: int is_palindrome(char *s);


Task 8 - Compare Strings with Wildcards

File: 101-wildcmp.c
📝 Description: Compares two strings with possible wildcard '*' in the second string. Returns 1 if they are identical, otherwise returns 0 using recursion.
💼 Prototype: int wildcmp(char *s1, char *s2);

Happy Coding 🚀