Advertisement
vaibhav1906

Factorial

Dec 18th, 2021
1,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. long long int f(int N){
  2.    
  3.     if(N==0)return 1;
  4.    
  5.     return N*f(N-1);
  6.    
  7. }
  8.  
  9. long long int factorial(int N){
  10.        //code here
  11.        
  12.    long long int ans = f(N);
  13.    
  14.    return ans;
  15.        
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement