#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int arr[10000];
int count=0,i=0,flag=1;
printf("Enter Input:");
while(flag)
{
scanf("%d",&arr[i]);
if(arr[i]==42)
flag=0;
else
flag=1;
i++;
count++;
}
for(i=0;i<count-1;i++)
{
printf("%d\n",arr[i]);
}
return 0;
}
can you plz explain me what is wrong with this code because it gives the same output that is required but i do no understand they considered it as wrong answer.