#include<iostream>
using namespace std;
int main()
{
    int i, j, n;
    
    cout<<"Permutation using factorial \n"<<endl;
    
    cout<<"Enter a number: ";
    cin>>n;
    
    for(i=1;i<=n;i++)
                     for(j=1;j<=n;j++)
                                        i=i*j;
                                        
    cout<<endl;
    cout<<n<<" factorial is "<<i-1<<endl;
    cout<<endl;
    
    system("pause");
    return 0;
}