How to get rid of getting NZEC error while submitting solution in java?

import java.util.;
import java.lang.

/* Name of the class has to be “Main” only if the class is public. */
class Codechef
public static void main (String[] args) throws java.lang.Exception
// your code goes here

Scanner s = new Scanner(;

		int n = s.nextInt();
		int factorial = 1;

	for(int i = n; i>= 1; i--) {
		 factorial = factorial * i;



I use this try catch method but although this method removes NZEC , it does not provide any solution at all .Please resolve this issue someone.

Thanks, it’s working now. I guess java’s still tryna catch itself!