MCPcopy 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

2using namespace std;
3
4int 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
12int main(){
13 int n;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected