I added algorithm to find factorial of a number

This commit is contained in:
nirmay0503 2019-10-23 20:14:43 +05:30
parent c0f018bd79
commit 61664e9639
3 changed files with 18 additions and 0 deletions

18
Math/factorial.cpp Normal file
View File

@ -0,0 +1,18 @@
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter number = ";
cin>>n;
int num=1;
for(int i=1;i<n;i++)
{
num*=i;
}
cout<<"Factorial of number is = ";
cout<<num<<endl;
return 0;
}

BIN
Math/factorial.exe Normal file

Binary file not shown.

BIN
Math/factorial.o Normal file

Binary file not shown.