Help me with SIGFPE error in my code

int main(){


long int n,x,count,i,rem,t;

scanf("%ld",&t);

while(t>0){
    count=0;

scanf("%ld",&n);

x=n;

while(n>0){

rem=n%10;

((x%rem)==0)?count++:count;
n=n/10;

}
//printf("%d\n",count);

t--;
}

printf("%ld\n",count);


    return 0;
}

Hint - what happens if n == 10?

1 Like