Skip to content

Commit

Permalink
Merge pull request Aniket965#710 from KKR-007/patch-4
Browse files Browse the repository at this point in the history
Create Factorial1.cpp
  • Loading branch information
Aniket965 authored Oct 8, 2018
2 parents 8e228e2 + 9318ca1 commit 3d270fc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions C++/Factorial1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
using namespace std;

int main()
{
unsigned int n;
unsigned long long factorial = 1;

cout << "Enter a positive integer: ";
cin >> n;

for(int i = 1; i <=n; ++i)
{
factorial *= i;
}

cout << "Factorial of " << n << " = " << factorial;
return 0;
}

0 comments on commit 3d270fc

Please sign in to comment.