Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a8b388c

Browse files
Add files via upload
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.
1 parent b454a6a commit a8b388c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎C Recursion Factorial.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include<stdio.h>
2+
unsigned long long int factorial(unsigned int i)
3+
{
4+
if(i<=1)
5+
{
6+
return 1;
7+
}
8+
return i*factorial(i-1);
9+
}
10+
int main()
11+
{
12+
int i=5;
13+
printf("Factorial of %d is: %d\n",i,factorial(i));
14+
return 0;
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /