0
What is recursion
plese give an example program
2 Respostas
+ 3
fact(int n)
{
if (n==1) return 1;
return fact(n-1)*n;
}
...
cout<<fact(n)//n!
...
+ 2
As you can see in kerpoo's comment,
recursion is when inside the function it calls itself (in simple words), you always need to have a condition (an exit condition)to end the recursion or it would continue "forever".