Skip to content

Commit

Permalink
Merge pull request #73 from sriaman/master
Browse files Browse the repository at this point in the history
create factorial.cpp
  • Loading branch information
ambujraj authored Oct 1, 2018
2 parents dd4af8b + db5d65d commit c2a65ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Factorial.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* create a factorial function for long integers*/
#include <iostream.h>
using namespace std;
int main(){
int i,n;
unsigned long long fact=1;// gives factorial of large numbers
cin>>n;
for(i=1;i<=n;i++){
fact =fact *i;
}
cout<<fact<<endl;
}

0 comments on commit c2a65ff

Please sign in to comment.