I am not able to give the inputs in this problem after I enter the n value.
Code (not able to give inputs)
Hey @souradipbiswas27
few changes in Your code
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
// int i = scn.nextInt();
int sum = 0;
while (sum >= 0) {
int i = scn.nextInt();
sum = sum + i;
if (sum < 0) {
break;
}
System.out.println(i);
}
//System.out.println(i);
}
}