0
1.3kviews
What do you mean by recursion? Write a program to find out summation of n no using recursion.
1 Answer
0
6views

In programming, when a function calls itself the case is called recursion and the function involved is called recursive function.

#include<stdio.h>
int add(int n);
void main()
{
int n;
    printf("Enter a positive integer: ");
    scanf("%d",&n);
    printf("Sum = %d",add(n));
getche();
}
int add(int n)
{
if(n!=0)
return n+add(n-1);/* recursive call */ …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.