i am facing difficulty in a program as without arrays its one test case cannot be fulfilled. what should i do?
Can i use array in programs before the section of array?
you can try this:
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int sum = 0;
while(sum >= 0&& scn.hasNext()){
int n = scn.nextInt();
sum += n;
if(sum < 0) break;
System.out.println(n);
}
}
}
ok thanku mam i got this now.