Why is this program not terminating when the input is x or X?

import java.util.*;

public class Main {

public static void main(String args[]) {

Scanner s = new Scanner(System.in);

	int N1,N2;
	char c;
	int result;
	do {
		c = s.next().charAt(0);
		switch (c) {
		case '+':
			N1 = s.nextInt();
			N2 = s.nextInt();
			result = N1+N2;
			System.out.println(result);
			break;
		case '-':
			N1 = s.nextInt();
			N2 = s.nextInt();
			result = N1-N2;
			System.out.println(result);
			break;
		case '*':
			N1 = s.nextInt();
			N2 = s.nextInt();
			result = N1*N2;
			System.out.println(result);
			break;
		case '/':
			N1 = s.nextInt();
			N2 = s.nextInt();
			result = N1/N2;
			System.out.println(result);
			break;
		case '%':
			N1 = s.nextInt();
			N2 = s.nextInt();
			result = N1%N2;
			System.out.println(result);
			break;
		default:
			System.out.println("Invalid operation. Try again.");}
	}
while (c!='x'||c!='X');
}

}

@abhishek_krishnan,
while (c!=‘x’||c!=‘X’); use && condition here.

Also, intead of default use if-else, because in your code if input is ‘x’ then also you will be printing System.out.println(“Invalid operation. Try again.”);

Corrected code:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.