Debudding help(small factorials:FCTRL2)

#include <stdio.h>
void fact(int n){
int a[1000000000],m=0,num=n,x=0;
while(n>0){
a[m]=n%10;
n/=10;
++m;
}
–num;
while(num–){
int temp=0;
for(int i=0;i<m;i++){
x=(a[i]*num)+temp;
a[i]=x%10;
temp=x/10;
}
while(temp–){
a[m]=temp%10;
temp/=10;
++m;
}
}
while(m-- > 0){
printf("%d",a[m]);
}
}
int main(){
int t, n;
scanf("%d",&t);
while(t–){

    scanf("%d",&n);
    fact(n); 
    printf("\n");
}
return 0;

}

the execution stops at 1st input of n. Can anyone help me fix the problem with my code?Thank you.