can u plz tell why this code is becoming infinite?
public class Patterntype1 {
public static void main(String args[]) {
Scanner sc= new Scanner(System.in);
int s = sc.nextInt();
int row=1;
int nst=s;
while(row<=s) {
//work
int cst=1;
while(cst<=nst) {
System.out.print("*");
}
System.out.println();
row=row+1;
nst=nst-1;
}
}