Hey all.
I am relatively a novice at programming.
I ran the following code in Unix gcc and it worked. But on the site it shows compile error. Please tell me why.
#include<stdio.h>
main ()
{
int a[99],b[99],i,n;
printf("Enter the numbers");
for(i=0;;i++)
{
scanf("%d",&a[i]);
if(a[i]==0)
{
n=i;
break;
}
if(a[i]>99)
{
printf("Incorrect Input");
}
}
for(i=0;i<n;i++)
{
if(a[i]!=42)
{
printf("\n%d\n",a[i]);
}
else
{
printf("\n%d\n",a[i]);
break;
}
}
return 0;
}
Thanks a lot.
Really appreciate the awesome work SPOJ is doing!