Earlier, we learned what are recursive functions. Now we are going to see a program based upon the concept of recursion.
In this post, we will see a C program that works using a recursive function. The program takes an integer n as input from the user and print the sum of numbers from 1 to n using a recursive function recursum().
printf("\nEnter a no. : ");
printf("\nSum of numbers from 1 to %d = %d",no,recursum(no));
int recursum(int n)
You may download the program below.
We hope that you found this article to be helpful.
Please share your thoughts in the Comments Section.
If you liked this article, then please like our Facebook page.