Getting a NZEC for Life Universe and Everyting. Please let me know the exact reason

and
everything
life
universe

#1

package com.codechef.pratice;

import java.io.InputStreamReader;
import java.util.Scanner;

class LifeUniverseEverything {

public static void main(String[] args) {
	 Scanner scanner = new Scanner(new InputStreamReader(System.in));
	 String input;
	 int inputInt;
	 while(true){
		 input = scanner.nextLine();
		 inputInt=Integer.parseInt(input);
		 if(inputInt == 42){
			 break;
		 }
		 System.out.println(input);
		 
	 }
}

}


#2

You don’t have to include the package name , so remove the first line of the code. The first line causes NZEC error in your code.


#3

That worked…thanks a lot :slight_smile: