ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

C Programming Recursion Examples, Programs

Recursion is the process by which a function calls itself. In programming languages, if a program calls a function inside the same function, then it is called a recursive call of the function. C programming supports the feature of recursion – with the help of recursion, we can call a function itself.

This section contains the C solved programs on recursion, practice these programs to learn the concept of recursion. Each function has the solved code, output, and explanation.

List of C programming Recursion Examples, Programs

  1. C program to read a value and print its corresponding percentage from 1% to 100% using recursion.
    C program to read a value and print its corresponding percentage from 1% to 100% using recursion
  2. C program to find factorial using recursion.
    This program will read an integer value and print its factorial using recursion, in this program there will be a function which will calculate factorial by calling itself (recursion).
  3. C program to print fibonacci series using recursion.
    This program will print the Fibonacci series till N numbers (which will be input through the user) using recursion.
  4. C program to calculate power of a number using recursion.
    This program will read base and power and calculate its result using recursion, for example base is 2 and power is 3 then result will be (2^3=8).
  5. C program to count digits of a number using recursion.
    This program will read an integer number and count its total digits using recursion, for example: input value is 34562, and then total number of digits is: 5.
  6. C program to find sum of all digits using recursion.
    This program will read an integer number and print sum of all digits using recursion, for example: input value is 34562, and then sum of all digits is: 20.
  7. C program to calculate length of the string using recursion.
    This program will read a string and count its total number of characters (length of the string) using recursion.
  8. C program to reverse an integer number using recursion.
    Here, we are going to learn how to reverse an integer number using recursion in C programming language?
  9. C program to check a given number is prime or not using recursion.
    Here, we are going to learn how to check a given number is prime or not using recursion in C programming language?
  10. C program to calculate the product of two numbers using recursion.
    Here, we are going to learn how to calculate the product of two numbers using recursion in C programming language?
ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.