Error is showing in output

import java.util.Scanner;

public class Main {
public static void main(String args[]) {

	Scanner sc = new Scanner(System.in);

	for (int s = 0; s >= 0;) {
		int n = sc.nextInt();
		s = s + n;
		if (s < 0) {
			break;
		} else {
			System.out.println(n);
		}
	}
}

}
This is my code and im getting error like this:
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Main.main(Main.java:9)

How to solve this error please help me.

@usha_sriram10 it basically means the element u r requesting does not exist .try and check your loops if they are running for more times than needed

@aa1,
What is your doubt in this question?