This code is not giving required output neither showing an erroe

package pattern;

import java.util.Scanner;

public class Pattern9 {

public static void main(String[] args) {
	Scanner se = new Scanner(System.in);
	int n = se.nextInt();
	int nst=1;
	int nsp=2*n-3;
	
	int row=1;
	while(row<=n) {
		for(int cst=1;cst<=nst;cst++) {
			System.out.print("*");
		}
	
		for(int csp=1;csp<=nsp;csp++) {
			System.out.print(" ");
		}
		int cst=1;
		if(row==n) {
			cst=2;
		}
		for(;cst<=nst;cst++) {
			System.out.print("*");
		}
	}
		System.out.println();
		nst=nst+1;
		nsp=nsp-2;
		row=row+1;

}

}

Hi @Adi_choudhary

Your code is running infinitely. That is why it is not giving any output.
The incremental condition for the while loop should be inside the loop.

System.out.println();

	nst=nst+1;
	nsp=nsp-2;
	row=row+1;

These lines should be inside while loop.