Zadatak3.7-faktorijel

#include <iostream>
using namespace std;

int main()
{
int i,j,n,p,k,c;
cin>>n;
i=1;
p=1;
while(i<=n)
{
p=p*i;
i++;
}
j=0;
while(p>0)
{c=p%10;
p=p/10;
cout<<c;
j++;
}
return 0;
}

Advertisements