what is wrong in this??
//code
#include<stdio.h>
#include<conio.h>
int main(void)
{int n[100],i,c;
printf(“Enter numbers of one or two digit:\n”);
for(i=1;;i++)
{ scanf("%d",&n[i]);
if(n[i]==42)
{ c=i;
break;}}
printf(“the numbers are:\n”);
for(i=1;i<c;i++)
printf("%d\n",n[i]);
}
Since the one user who had answered has been suspended and his answer is not visible, I would answer it again.
You are coding in turbo C++ style, please google how to change to GNU C++ and it will be very helpful in this transition. I would still like to point out one more common mistake among beginners. You do not need the “Please enter the integer” and all in your code. The way an online judge roughly works is by comparing the your output to the intended output, so you should try to keep the output format EXACTLY the same like in the problem statement. You can ignore whitespaces like spaces and endlines. I hope this helps.