Runtime Error(NZEC)

why i m getting Runtime Error(NZEC) in my program??
this program is running successfully with my compiler.

#include<stdio.h>

int main(void)
{
   long int n,k,i,temp=0;

   scanf("%ld %ld",&n,&k);

    while(n--)
    {
        scanf("%d",&i);

            if (i%k==0)
            {
                temp++;
            }

    }
    printf("%ld",temp);
    return 0;
}

plz help me to find the problem…

The program is running successfully ,

see this ideone link

don’t keep space inside format specifiers of scanf. remove space.

No, it’s not, but it’s not your fault, how can one understand this from code?

Please read this, to ask better next time :wink:

yaa agree :slight_smile:

Maybe it’s not valid input, but how should I know, right?

yaa you cannot guess unless you know the problem’s input format .