life,universe and everything

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]);
}

why doesn’t codechef compiler accept this??

First Of all u don’t have to use conio.h

Then you also don’t have to display the message printf(“Enter numbers of one or two digit:\n”);

thanks!!

Since the one user who had answered has been suspended and his answer is not visible, I would answer it again. :confused:

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. :slight_smile:

why did he get suspended?

You should check his karma history :stuck_out_tongue:

My gawd , 25 upvotes from same question with 4 answers

Hahaha. XD

//