Created
June 21, 2018 04:26
-
-
Save aligalehban/305ca1a7046733c158d164911d6f27a0 to your computer and use it in GitHub Desktop.
Find Factorial of number in c++ source code - www.alighalehban.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment