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

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);
		 
	 }
}

}

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.

1 Like

That worked…thanks a lot :slight_smile: