small factorials

#include<stdio.h>
int length[100];
int func(int data[100][100],int m,int i){
int temp=0,j=0,z=0;
if(m!=0){
while(m){
j=0,temp=0;
while(temp||j<length[i]){
if(j<length[i])
z=data[i][j]*m+temp;
else
z=temp;
data[i][j]=z%10;
temp=z/10;
j++;
}
length[i]=j;
m=m-1;
}
}
return 0;
}

int main(){
int n,i=0,j=0,x,m,k=0;
int data[100][100];
scanf("%d",&n);
while(i!=n){
scanf("%d",&x);
m=x;
j=0;
while(x){
data[i][j]=x%10;
x=x/10;
j++;
}
length[i]=j;
func(data,m-1,i);
i++;
}
i=0;
while(i!=n){
k=length[i]-1;
while(k+1){
printf("%d",data[i][k]);
k–;
}
printf("\n");
i++;
}
return 0;
}

i submitted this code for the calculation of fatorials upto 100
but it says wrong ans
but it is executing successfully and giving the right ans in code,compile and run thing??