I have started on codechef with easiest problem Life,the universe ,everything problem http://www.codechef.com/problems/TEST
My solution to this is
#include<stdio.h>
int main()
{
int a[100];
int i,n=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]==42)
{
break;
}
else
{
printf("%d",a[i]);
printf("\n");
}
}
return(0);
}
The chef is telling me wrong answer .Can someone please point out my mistake in code.