Basic Calculator Error

import java.util.*;
public class BasicCalculator 
{
	public static void main(String args[])
	{
		Scanner sr = new Scanner(System.in);
		char ch = sr.nextLine().charAt(0);
		int N1, N2;
		while(ch!='x' || ch!='X')
		{
			if(ch == '+'|| ch=='*'|| ch =='%' || ch =='/'|| ch =='-')
			{
				N1 = sr.nextInt();
				N2 = sr.nextInt();
				if(N2>0)
				{
					if(ch == '+')
						System.out.println(N1+N2);
					if(ch == '-')
						System.out.println(N1-N2);
					if(ch == '*' )
						System.out.println(N1*N2);
					if(ch == '%' && N2!=0)
						System.out.println(N1%N2);
					if(ch == '/' && N2!=0)
						System.out.println(N1/N2);
				}
			}
				else 
					System.out.println("Invalid operation. Try again.");
			
			String st = sr.next();
			ch = st.charAt(0);
		}
	}

}

This code runs just fine in my Eclipse IDE and gives the required output but gives a runtime error NoSuchElementException when submiting.

Hii Abhinav,
in while condition && operator should be use instead of || operator because if ch == ‘x’ the second condition i.e. ch != ‘X’ will become true and since you have used || operator you will enter into while loop but for ch ==‘x’ your while loop should break.