Why my loop is not printing anything after 10948

I am providing the value of n -> greater than 10948 then it is printing till 10948 only
for(long i=4;i<n;i=i+2){
System.out.println(“2”+" “+i+” "+(i+1));
can u please help in getting what is going wrong with this loop above .

I guess there might be a limit to the number of characters printed in the output of codechef IDE. You can try this in your local system or other online IDEs. There is nothing wrong with the code.

I need to submit my question on codechef itself so what can i need to change.
It is printing right on eclipse.

Can you share the link to the problem?

Well, the questions of ongoing contests should not be discussed. But I would like to bring your attention to one detail in the question you might be missing. You have to determine the minimum no. of days.

But my logic is working fine,well i have not shared the full code ,so is there any other
way to print what i want to print

It is all about my this loop only

I can’t say if your logic is fully correct without seeing your code. I’m afraid you’ll have to figure it out on your own or wait till the contest is over.

Is there any way to print differently so that i can print what i want to ?

please use faster implementation of standard i/p and o/p…

can u plz suggest i dont know actually

Check this:

getting same problem in c++

1 Like

Can you share the link to your solution?