Why do I get a Runtime exception?

,

Why am i getting runtime exception?

There are four types of Runtime exception, and you can see which one you are getting by hovering your mouse over the icon. You cannot know anything more specific; for example the exact Exception thrown in Java. Note that some errors could lead onto other errors, so even if you are getting one particular message, you should check each one separately.

RE (NZEC).

This is just one possible option, as mentioned in @admin’s answer, there 4 types: SIGSEGV, SIGABRT, SIGFPE, NZEC

#include<stdio.h>
int main()
{
int c=0,p;
long int a[100], i,j,n,m;
scanf("%ld%ld",&n,&m);
for(i=0;i<n;i++)
{
scanf("%ld",&a[i]);
p=a[i];
if(p%m==0)
{
c++;
}
}
printf("%d",c);
return 0;
}

#include<stdio.h>
void display(int);
void main()
{int n;
scanf("%d\n",&n);
display(n);
}
void display(int n)
{
int m,z[n],i,j=0;

for(i=0;i<n;i++)
{scanf("%d\n",&m);
if((m%100==m))
{z[j]=m;
j++;
}
}
for(i=0;i<j;i++)
{if(z[i]!=42)
printf("%d\n",z[i]);
else
break;
}
}

#include<stdio.h>
int a[1000];
void main()
{
int t,i,j,s;
printf(“enter number of cases”);
scanf("%d",&t);
for(i=0;i<t;i++)
{
printf("\nenter data");
scanf("%d",&a[i]);
}
printf("%d",t);
for(i=0;i<t;i++)
{
s=0;
if(a[i]!=0)
{
for(j=a[i];j>0;j–)
{
if(a[i]%j==0)
s=s+j;
}
}
printf("\n%d",s);
}
}

#include<stdio.h>

int main()
{
int t;
printf("\n enter the number of test case : “);
scanf(”%d",&t);
while(t>0)
{
int nbNote=0,amount=0;
int nb100=0,nb50=0,nb10=0,nb5=0,nb2=0,nb1=0;
printf("\n enter the amount : “);
scanf(”%d",&amount);
if(amount%100>=0)
{
nb100=amount/100;
nbNote+=nb100;
amount-=(nb100100);
}
if(amount%50>=0)
{
nb50=amount/50;
nbNote+=nb50;
amount-=(nb50
50);
}
if(amount%10>=0)
{
nb10=amount/10;
nbNote+=nb10;
amount-=(nb1010);
}
if(amount%5>=0)
{
nb5=amount/5;
nbNote+=nb5;
amount-=(nb5
5);
}
if(amount%2>=0)
{
nb2=amount/2;
nbNote+=nb2;
amount-=(nb22);
}
if(amount%1>=0)
{
nb1=amount/1;
nbNote+=nb1;
amount-=(nb1
1);
}
printf("\n number of notes = %d",nbNote);
t–;
}
return 0;
}

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
scanf("%2d",&i);

while(i=!42)
{
printf("%2d",i);
scanf("%2d",&i);
}
return 0;

}

#include<stdio.h>
int main()
{
int x;
float y,total;
scanf("%d %f",&x,&y);
if(x%5==0 && x<=y)
{
total=(y-x)-0.50;
printf(".2f\n",total); } else { printf(".2f\n",y);
}
}

why do i get run time error(SIGSEV) for thi code
https://www.codechef.com/viewsolution/8927820

#include <stdio.h>
void main()
{
int x;
float y;
scanf("%d",&x);
scanf("%f",&y);
if(x%5==0)
{
if(x<y)
{
y=y-x;
y=y-0.5;
printf("%.2f",y);

	}
	else
	{	printf("%.2f",y);
	}
															
		}
else
			{
						printf("%.2f",y);
			}

}link text

Why an i getting run-time error in this program even if its running in my Net Beans ?https://www.codechef.com/submit/KOL1502

//Sum of palindromic numbers
#include<stdio.h>
main()
{
int n,r,sum=0,count=0,temp;
printf(“Enter a number:”);
scanf("%d",&n);
temp = n;
while(n>0)
{
r =n%10;
sum = (sum * 10) + r;
n = n/10;
count = count + r;
}
if(sum==temp)
{
printf("%d is a palindrome!\n",temp);
printf(“The sum is:%d\n”,count);
}
else
{
printf("%d is not a palindrome!\n",temp);
}
}

Why i am getting run time error? I am running it on linux platform.

runtime errors occurs when there is any logic error in that program or in any exceptional cases

My code is wprking fine on all ides including ideone and even on codechef compiler but still it is not getting successful submission . Please can somebody help me on this? here is the link to my java code:

#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t–)
{
int n,m,p,i,j,b;
scanf("%d%d",&n,&m);
int a[n];
for(i=0;i<n;i++)
a[i]=0;
while(m–)
{ b=1;
scanf("%d",&p);
if(a[p]<=0)
a[p]=0;
for(i=p-1,j=p+1;i>=0||j<=n-1;i–,j++)
{
if(a[i]<b)
a[i]=b;
if(a[j]<b)
a[j]=b;
b++;
}

	}
	for(i=0;i<n;i++)
	printf("%d ",a[i]);
	printf("\n");
}
return 0;

}

#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t–)
{
int n,m,p,i,j,b;
scanf("%d%d",&n,&m);
int a[n];
for(i=0;i<n;i++)
a[i]=0;
while(m–)
{ b=1;
scanf("%d",&p);
if(a[p]<=0)
a[p]=0;
for(i=p-1,j=p+1;i>=0||j<=n-1;i–,j++)
{
if(a[i]<b)
a[i]=b;
if(a[j]<b)
a[j]=b;
b++;
}

	}
	for(i=0;i<n;i++)
	printf("%d ",a[i]);
	printf("\n");
}
return 0;

}

include

int main()
{
int t;
scanf("%d",&t);
while(t–)
{
int n,m,p,i,j,b;
scanf("%d%d",&n,&m);
int a[n];
for(i=0;i<n;i++)
a[i]=0;
while(m–)
{ b=1;
scanf("%d",&p);
if(a[p]<=0)
a[p]=0;
for(i=p-1,j=p+1;i>=0||j<=n-1;i–,j++)
{
if(a[i]<b)
a[i]=b;
if(a[j]<b)
a[j]=b;
b++;
}

    }
    for(i=0;i<n;i++)
    printf("%d ",a[i]);
    printf("\n");
}
return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
int n,i,j,k,T,a[n],sum=0;

scanf("%d",&T);
if(T<1 || T>30)
{
exit(0);
}

for(i=1;i<=T;i++)
{

int sum=0;
int sum1=sum;

scanf("%d",&n);
int q=n;

for(j=0;j<n;j++)
{
scanf("%d",&a[j]);
if(a[j]<1 || a[j]>1000000)
{
exit(0);
}
}

for(k=0;k<n;k++)
{
sum=sum+a[k];
}

sum1=sum;

if(sum1%2==0)
{
printf("%d\n",n);

}
else
{
for(k=0;k<n;k++)
{
q–;
sum1=sum1-a[k];
if(sum1%2==0)
{
printf("%d\n",q);
break;
}
}
}
}

return 0;

}