please help me in finding out runtime error (Nzec) in my c code its properly working on code block but not on codechef?

#include<stdio.h>
void main()
{
int a,b[2000],i,j,k,l=0;
//printf(“enter no”);
scanf("%d",&a);
if(a){
//printf(“enter nos”);
for(i=0;i<a;i++)
scanf("%d",&b[i]);
for(i=0;i<a;i++)
{
for(j=0;j<a;j++)
{
for(k=0;k<a;k++)
{
if(b[i]<=(b[j]+b[k]) && b[j]<=(b[i]+b[k]) && b[k]<=(b[j]+b[i]))
{
if(i!=j && j!=k && k!=i)
l++;}}
}
}
printf("%d",((a)(a-1)(a-2)/6)-(l/6));
}
return 0;
}

Can u please specify for which problem u are asking the question???

@ankit_wagadre:you are declaring your main function as void but you are returning a value(i.e return 0), i think this may be the reason, once try removing return value

1 Like

Moreover returning a value from main is not allowed when declared as void.

use int main

//