Project Euler - Factorial digit sum (Problem No -- 20)

Problem link

Solution :

/// Author : shohan
#include<stdio.h>
#define MAX 500
#define LIMIT 100
int main()
{
int fact[MAX]={0},i,tmp=0,carry=0,sum=0,j;
fact[0]=1;
int size=1;
carry=0;
// start Multiply
for(j=1;j<=LIMIT;j++){
for(i=0;i<size;i++){
tmp=fact[i]*j+carry;
fact[i]=tmp%10;
carry=tmp/10;
}
while(carry!=0){
fact[size++]=carry%10;
carry=carry/10;
}
} // end Multiply
for(j=size-1;j>=0;j--){
sum=sum+fact[j];
} // add digit
printf("sum : %d",sum); // print
return 0;
}