Can you please specifically tell whats wrong in this code which i have pasted down below

package ChallengesOne;
import java.util.Scanner;
public class Challenge8 {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
char ch = scn.next().charAt(0);
int n1;
int n2;
int ans;

	while (true) {
		// Multiplication
		if (ch == '*') {
			n1 = scn.nextInt();
			n2 = scn.nextInt();
			ans = n1 * n2;
			System.out.println(ans);
		}

		// Addition
		else if (ch == '+') {
			n1 = scn.nextInt();
			n2 = scn.nextInt();
			ans = n1 + n2;
			System.out.println(ans);
		}

		// Subtraction
		else if (ch == '-') {
			n1 = scn.nextInt();
			n2 = scn.nextInt();
			ans = n1 - n2;
			System.out.println(ans);
		}

		// Division or Quotient
		else if (ch == '/') {
			n1 = scn.nextInt();
			n2 = scn.nextInt();
			ans = n1 / n2;
			System.out.println(ans);
		}

		// Remainder
		else if (ch == '%') {
			n1 = scn.nextInt();
			n2 = scn.nextInt();
			ans = n1 % n2;
			System.out.println(ans);
		}
		// terminate
		else if (ch == 'x' || ch == 'X') {
			System.exit(0);
		}
		// invalid operation
		else {
			System.out.println("Invalid operation.Try again.");
		}
		ch = scn.next().charAt(0);
	}

}

}

System.out.println(“Invalid operation.Try again.”);

there is a space between full stop and Try

But why is that creating a problem?
And is rechecked there’s no space between full stop and Try

you need to add a space between full stop and Try
its given as output format in the question .your logic is right but you need to follow the format to pass the test cases for any question
Please mark your doubt as resolved and rate as well :slight_smile:

Okay. Thanks.
That worked.