Pattern 5 is forming an infinite loop with my code

package patterns;

import java.util.Scanner;

public class Pattern5 {

public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int row = sc.nextInt();
	int nsp=0;
	int nst=row;
	int i = 1;
	while(i<=row){
		int k=1;
		while(k<=nsp)
		{System.out.print(" ");
		k++;
		}
		int j = 1;
		while(j<=nst){
			System.out.print("*");
			j++;
		}
		
	}System.out.println();
	i++;
	nsp++;
	nst--;
	
}

}

@mishikasrvastava

This snippet of code should be in ya outer loop right? Here i have corrected ya code.

If your query is resolved, do mark the doubt resolved and rate!
Happy coding!

it is still showing compilation error

@mishikasrvastava post your code, have you tried running mine?