Please check my code i made a calculator and its giving an error

It is giving an error after printing the Answer but it should loop to get the user input again. or Quit is (q/Q) is the input.

package lecture3;

import java.util.Scanner;

public class calculator {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int ans = 0;

	while (true) {
		System.out.println("Enter Number 1");
		double n1 = scn.nextInt();

		System.out.println("Enter Number 2");
		double n2 = scn.nextInt();

		System.out.println("Choose your operator (+, -, x, /, %) \n or Press Q to Quit");
		char op = scn.next().charAt(0);

		scn.close();

		if (op == '+' || op == '-' || op == 'x' || op == 'X' || op == '*' || op == '/' || op == '%') {

			if (op == '+') {

				ans = (int) (n1 + n2);

			} else if (op == '-') {

				ans = (int) (n1 - n2);

			} else if (op == '*' || op == 'x' || op == 'X') {

				ans = (int) (n1 * n2);

			} else if (op == '/') {

				ans = (int) (n1 / n2);

			} else if (op == '%') {

				ans = (int) (n1 % n2);

			} else {
				System.out.println("Invalid Operation");
			}

		}

		else if (op == 'Q' || op == 'q') {
			break;
		} else {
			System.out.println("Invalid Operation");
		}
		System.out.println(ans);
	}

}

}

@discobot You have closed the scanner after taking the operator in the first operation due to which there is no scanne available so Remove line : scn.close();

Hi! To find out what I can do, say @discobot display help.