For test case 4 i am getting run error

public static void main(String[] args) {
	boolean c=true;
	int sum=0;
	Scanner s=new Scanner(System.in);
	while(c) {
		int n=s.nextInt();
		sum=sum+n;
		if(sum<0)
			c=false;
		if(c)
            System.out.println(n);
		
	}

}

}

Hi @Anshuman-Behera-1168641663271515,you code is passing all the test cases in my system.Try again to submit your code.

Hi @Anshuman-Behera-1168641663271515
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.