The document outlines a lab sheet focused on recursion in C programming. It includes ten exercises that require writing recursive functions for various tasks such as printing natural numbers, calculating summation, factorial, power, sum of digits, Fibonacci numbers, array elements, string reversal, product of two numbers, and summing even and odd numbers. Each task aims to enhance understanding and application of recursion in programming.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views
Lab sheet_Recursion
The document outlines a lab sheet focused on recursion in C programming. It includes ten exercises that require writing recursive functions for various tasks such as printing natural numbers, calculating summation, factorial, power, sum of digits, Fibonacci numbers, array elements, string reversal, product of two numbers, and summing even and odd numbers. Each task aims to enhance understanding and application of recursion in programming.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Programming Methodologies
Lab sheet – Recursion
1. Write a program in C to print the first 50 natural numbers using recursion.
2. Write a C program to calculate the summation up to a given number using recursion 3. Write a C program to calculate the factorial of a given number using recursion 4. Write a C program to implement a recursive function to calculate the power of a number 5. Write a C program to implement a recursive function to calculate the sum of digits of a given number. 6. Write a C program to implement a recursive function to get the nth Fibonacci number. 7. Write a program in C to print the array elements using recursion 8. Write a C program to reverse a string using recursion
9. Write a C program to implement a recursive function to calculate the
product of two numbers without using the multiplication operator. 10. Write a C program to implement a recursive function to calculate the sum of even and odd numbers in a given range.