mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
19 lines
251 B
C++
19 lines
251 B
C++
#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;
|
|
}
|