Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chaharnishant11/CodeIn10DSA
/ factorial
Function
factorial
C++/Code/factorialUsingFunction.cpp:4–10 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
2
using namespace std;
3
4
int factorial(int n){
5
int ans = 1;
6
for(int i=1;i<=n;i++){
7
ans = ans * i;
8
}
9
return ans;
10
}
11
12
int main(){
13
int n;
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected