Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ fact
Function
fact
CPP/recursion/recursion 1.cpp:18–21 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
16
// func(n-1);
17
}
18
int fact(int n){
19
if(n==0) return 1;
20
return fact(n-1)*n;
21
}
22
int main(){
23
read(n);
24
cout<<fact(n)<<endl;
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected