What is wrong with my code for this pattern?

Scanner scn = new Scanner(System.in) ;
int n = scn.nextInt();

	int nst = 1;
	
	
	for(; nst <= n; nst++) {
		
		int space = 1;
		while( nst < space && space <= n) {
			System.out.print(" ");
			space++;
		}
		
		int cst = 1;
		while(cst <= nst) {
			System.out.print("*");
			cst++;
		}
		
		System.out.println();
	}