diff --git a/cpp to find the factorial b/cpp to find the factorial new file mode 100644 index 0000000..d18c098 --- /dev/null +++ b/cpp to find the factorial @@ -0,0 +1,19 @@ +#include +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; +}