Runtime error on codechef; runs OK on eclipse; Ques: life, the universe, and Everything (java)

I have tried a lot to find the problem in this code, but was not able to. Please help

import java.util.Scanner;
import java.util.*;
 
class Life {
	public static void main(String args[]) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
			
		int inp=0;
		do
		{
		inp=sc.nextInt();
		if(inp !=44)
		{System.out.print(inp);}
			
		}
		while(inp !=44);
		sc.close();
		
	}

}

check your condition again!

it should be inp!=42.

OOPS!!
Thanks a lot!!! :smiley:

welcome :slight_smile: